qol changes

- minor changes to snippets
- minor changes to aliases
- switching from ycm to coc for nvim autocomplete
master
TiynGER 4 years ago
parent 614284d041
commit 81dcd6f453

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

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

@ -6,11 +6,15 @@ if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
autocmd VimEnter * PlugInstall autocmd VimEnter * PlugInstall
endif 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') call plug#begin('~/.local/share/nvim/plugged')
Plug 'lervag/vimtex' , {'for' : 'tex'} " Tex library for autocompletion Plug 'lervag/vimtex' , {'for' : 'tex'} " Tex library for autocompletion
Plug 'donRaphaco/neotex' , {'for': 'tex'} " Asynchronous pdf rendering Plug 'donRaphaco/neotex' , {'for': 'tex'} " Asynchronous pdf rendering
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " Filetree 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 'airblade/vim-gitgutter' " Git Upgrades
Plug 'qpkorr/vim-renamer' " Bulk renamer Plug 'qpkorr/vim-renamer' " Bulk renamer
Plug 'sirver/ultisnips' " Snippets 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 'ryanoasis/vim-devicons' " Enable Icons for vim
Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " Color Preview Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " Color Preview
Plug 'tomasiser/vim-code-dark' " adding colorscheme 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 'tpope/vim-surround' " Help for quotes/parantheses
Plug 'alvan/vim-closetag' " Auto close HTML tags Plug 'alvan/vim-closetag' " Auto close HTML tags
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
call plug#end() 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
colorscheme codedark colorscheme codedark
" Rainbow " Rainbow
au FileType java,c,cpp,py,h call rainbow#load() au FileType,BufNewFile,BufRead java,c,cpp,py,h call rainbow#load()
" You complete me " Ultisnippets
let g:ycm_global_ycm_extra_conf = '/home/tiynger/.config/nvim/ycm_extra_conf.py' let g:UltiSnipsExpandTrigger="<alt-j>"
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}
" Tagbar " Tagbar
map <F3> :TagbarToggle<CR> map <F3> :TagbarToggle<CR>
@ -76,10 +126,6 @@ let g:Hexokinase_optInPatterns = [
let g:Hexokinase_highlighters = ['backgroundfull'] let g:Hexokinase_highlighters = ['backgroundfull']
autocmd VimEnter * HexokinaseTurnOn autocmd VimEnter * HexokinaseTurnOn
" Vim-Mardown
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_no_default_key_mappings=1
" Vim-Closetag " Vim-Closetag
let g:closetag_filenames = '*.html,*.xhtml,*.phtml' let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx' let g:closetag_xhtml_filenames = '*.xhtml,*.jsx'
@ -126,6 +172,22 @@ set number relativenumber
" Speedup vim with long lines " Speedup vim with long lines
set ttyfast set ttyfast
set lazyredraw 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 " enable persistent undo
if has('persistent_undo') if has('persistent_undo')
@ -144,9 +206,6 @@ autocmd BufWritePre * :call TrimWhitespace()
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Clean LaTex build files " Clean LaTex build files
autocmd VimLeave *.tex !texclear % autocmd VimLeave *.tex !texclear %
" Read files correctly
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.h set filetype=c
" Mapping Dictionaries " Mapping Dictionaries
map <F5> :setlocal spell! spelllang=de_de<CR> map <F5> :setlocal spell! spelllang=de_de<CR>
@ -170,16 +229,19 @@ nnoremap S :%s//gI<Left><Left><Left>
" Start Formatting section " Start Formatting section
autocmd FileType java,python,c,tex,latex noremap <F8> gggqG
au FileType python setlocal formatprg=autopep8\ - au FileType python setlocal formatprg=autopep8\ -
au FileType java setlocal formatprg=astyle\ --indent=spaces=2\ --style=google au FileType java setlocal formatprg=astyle\ --indent=spaces=2\ --style=google
autocmd FileType java setlocal shiftwidth=2 softtabstop=2 autocmd FileType java setlocal shiftwidth=2 softtabstop=2
au FileType c setlocal formatprg=astyle\ --mode=c au FileType c setlocal formatprg=astyle\ --mode=c
au FileType tex,latex setlocal formatprg=latexindent\ - 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 " End Formatting section

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

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

Loading…
Cancel
Save