qol changes

- minor changes to snippets
- minor changes to aliases
- switching from ycm to coc for nvim autocomplete
master
TiynGER 4 years ago
parent a3f2a5e1b1
commit f704dd8b5e

@ -39,7 +39,7 @@ haste() {
}
#khal
alias calendar="khal"
alias calendar="khal interactive"
# khard
alias contacts="khard"
@ -53,8 +53,9 @@ alias tree="lsd --tree"
# mkdir
alias mkdir="mkdir -p"
# mount
alias mount="mount |column -t"
# mutt
alias mutt="neomutt"
alias upmutt="mbsync -a && neomutt"
# mv
alias mv="mv -i"

@ -28,7 +28,7 @@
<alias>
<family>monospace</family>
<prefer>
<family>JetBrainsMono Nerd Font Mono</family>
<family>JetBrainsMono Nerd Font Mono</family>
<family>BlexMono Nerd Font Mono</family>
<family>Joy Pixels</family>
<family>Noto Color Emoji</family>

@ -1,9 +0,0 @@
[Default Applications]
x-scheme-handler/mailto=mail.desktop
text/plain=text.desktop;
text/x-shellscript=text.desktop;
application/pdf=pdf.desktop;
image/png=img.desktop;
image/jpeg=img.desktop;
image/gif=img.desktop;
application/rss+xml=rss.desktop

@ -1,7 +0,0 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =5
let g:netrw_dirhist_5='/etc/security'
let g:netrw_dirhist_4='/home/tiynger/irc/irc.gnu.org/#gnu'
let g:netrw_dirhist_3='/home/tiynger/irc/irc.hackint.org/#36c3-hall-b'
let g:netrw_dirhist_2='/home/tiynger/.config/zsh'
let g:netrw_dirhist_1='/boot/loader/entries'

@ -29,10 +29,11 @@ snippet ,fr "Frame" A
\frametitle{$1}
$2
\end{frame}
$3
endsnippet
snippet ,em "Emphasis" A
\emph{$1}
\emph{$1} $2
endsnippet
snippet ,bf "Bold" A
@ -55,12 +56,14 @@ snippet ,ol "Enumeration" A
\begin{enumerate}
\item $1
\end{enumerate}
$2
endsnippet
snippet ,ul "Itemization" A
\begin{itemize}
\item $1
\end{itemize}
$2
endsnippet
snippet ,li "List element" A
@ -76,6 +79,7 @@ snippet ,tab "Tabular" A
\begin{tabular}
$1
\end{tabular}
$2
endsnippet
snippet ,a "Hyperlink" A
@ -87,34 +91,45 @@ snippet ,sc "Small caps" A
endsnippet
snippet ,chap "Chapter" A
\chapter{$1}
\chapter {$1}
$2
endsnippet
snippet ,sec "Section" A
\section*{$1}
\section* {$1}
$2
endsnippet
snippet ,lsec "Section" A
\section {$1}
$2
endsnippet
snippet ,ssec "Subsection" A
\subsection*{$1}
\subsection* {$1}
$2
endsnippet
snippet ,sssec "Subsubsection" A
\subsubsection*{$1}
\subsubsection* {$1}
$2
endsnippet
snippet ,up "Use Packagage" A
\usepackage{$1}
snippet ,par "Paragraph" A
\paragraph* {$1}
$2
endsnippet
snippet ,tt "Typewriter" A
\texttt{$1} $2
snippet ,spar "Subparagraph" A
\subparagraph* {$1}
$2
endsnippet
snippet ,par "Paragraph" A
\paragraph*{$1}
snippet ,up "Use Packagage" A
\usepackage{$1}
$2
endsnippet
snippet ,ttt "Typewriter" A
\texttt{$1} $2
endsnippet

@ -6,11 +6,15 @@ if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
autocmd VimEnter * PlugInstall
endif
" Read files correctly
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.h set filetype=c
call plug#begin('~/.local/share/nvim/plugged')
Plug 'lervag/vimtex' , {'for' : 'tex'} " Tex library for autocompletion
Plug 'donRaphaco/neotex' , {'for': 'tex'} " Asynchronous pdf rendering
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " Filetree
Plug 'majutsushi/tagbar' " Show tags
Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " Show tags
Plug 'airblade/vim-gitgutter' " Git Upgrades
Plug 'qpkorr/vim-renamer' " Bulk renamer
Plug 'sirver/ultisnips' " Snippets
@ -20,31 +24,77 @@ Plug 'junegunn/fzf.vim' " Quickly jump files using fzf
Plug 'ryanoasis/vim-devicons' " Enable Icons for vim
Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " Color Preview
Plug 'tomasiser/vim-code-dark' " adding colorscheme
"Plug 'blueshirts/darcula'
Plug 'godlygeek/tabular' " Tabularizing things
Plug 'plasticboy/vim-markdown' , {'for': 'md'} " Helps for markdown
Plug 'tpope/vim-surround' " Help for quotes/parantheses
Plug 'alvan/vim-closetag' " Auto close HTML tags
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
call plug#end()
" Coc
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_global_extensions = [
\ 'coc-java',
\ 'coc-python',
\ 'coc-vimtex',
\ ]
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
autocmd CursorHold * silent call CocActionAsync('highlight')
nmap <leader>rn <Plug>(coc-rename)
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Colorscheme
colorscheme codedark
" Rainbow
au FileType java,c,cpp,py,h call rainbow#load()
" You complete me
let g:ycm_global_ycm_extra_conf = '/home/tiynger/.config/nvim/ycm_extra_conf.py'
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_semantic_triggers = {
\ 'tex' : ['{']
\}
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
let g:ycm_filepath_blacklist = {'*': 1}
au FileType,BufNewFile,BufRead java,c,cpp,py,h call rainbow#load()
" Ultisnippets
let g:UltiSnipsExpandTrigger="<alt-j>"
" Tagbar
map <F3> :TagbarToggle<CR>
@ -76,10 +126,6 @@ let g:Hexokinase_optInPatterns = [
let g:Hexokinase_highlighters = ['backgroundfull']
autocmd VimEnter * HexokinaseTurnOn
" Vim-Mardown
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_no_default_key_mappings=1
" Vim-Closetag
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx'
@ -126,6 +172,22 @@ set number relativenumber
" Speedup vim with long lines
set ttyfast
set lazyredraw
" TextEdit might fail without hidden
set hidden
" Disable Backupfiles for Lsp
set nobackup
set nowritebackup
" Dont pass messages to ins-completion-menu
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
" enable persistent undo
if has('persistent_undo')
@ -144,9 +206,6 @@ autocmd BufWritePre * :call TrimWhitespace()
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Clean LaTex build files
autocmd VimLeave *.tex !texclear %
" Read files correctly
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.h set filetype=c
" Mapping Dictionaries
map <F5> :setlocal spell! spelllang=de_de<CR>
@ -170,16 +229,19 @@ nnoremap S :%s//gI<Left><Left><Left>
" Start Formatting section
autocmd FileType java,python,c,tex,latex noremap <F8> gggqG
au FileType python setlocal formatprg=autopep8\ -
au FileType java setlocal formatprg=astyle\ --indent=spaces=2\ --style=google
autocmd FileType java setlocal shiftwidth=2 softtabstop=2
au FileType c setlocal formatprg=astyle\ --mode=c
au FileType tex,latex setlocal formatprg=latexindent\ -
autocmd FileType java,python,c,tex,latex noremap <F8> gggqG
au FileType markdown noremap <F8> :silent %!prettier --stdin-filepath % <CR>
" End Formatting section

@ -23,13 +23,13 @@ super + F7
super + F8
dmenuumount
super + F9
sudo -A systemmctl restart NetworkManager
sudo -A systemctl restart NetworkManager
super + F10
prompt "Lock computer?" slock
prompt "Lock computer?" "slock"
super + F11
prompt "Shutdown computer?" sudo -A shutdown -h now
prompt "Shutdown computer?" "sudo -A shutdown -h now"
super + F12
prompt "Reboot computer?" sudo -A reboot now
prompt "Reboot computer?" "sudo -A reboot now"
XF86Launch1
xset dpms force off
XF86AudioMute

@ -3,8 +3,8 @@
# toggle external monitor
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
intern=LVDS-1
extern=HDMI-2
intern=LVDS1
extern=HDMI2
(xrandr | grep "$extern disconnected")
(xrandr --listactivemonitors | grep $extern) || ((xrandr --output $extern --right-of $intern --auto && setbg) & exit)
(xrandr --listactivemonitors | grep $extern) && xrandr --output $extern --off

Loading…
Cancel
Save