From d9c849e25ce78d89110106ba66a0ff62f4f7b973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 13 Sep 2016 16:24:51 +0200 Subject: Update vimrc and set wordlist for zsh --- vimrc | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 63a51ba..11f4203 100644 --- a/vimrc +++ b/vimrc @@ -10,24 +10,41 @@ set exrc set secure set title +set hidden +set undofile +set undodir=~/.cache/vim-undo// +set hlsearch +set foldmethod=syntax + +" GitGutterEnable + function InitBase() - set tabstop=4 - set softtabstop=4 - set shiftwidth=4 - set noexpandtab set number - set hidden - set undofile - set undodir=~/.cache/vim-undo// set colorcolumn=82 set textwidth=82 highlight ColorColumn ctermbg=darkgray - set hlsearch - - set foldmethod=syntax +endfunction - execute 'GitGutterEnable' +" Tabs setting. In default we want 4 spaces tab, but allows also 8 spaced tabs +set noexpandtab +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 +function TabToogle() + if &tabstop != 4 + set tabstop=4 + set shiftwidth=4 + set softtabstop=4 + echom 'Tab stop set to 4' + else + set tabstop=8 + set shiftwidth=8 + set softtabstop=8 + echom 'Tab stop set to 8' + endif + " Soft tab stop is here only for posibility of expandtab endfunction +command TabToogle call TabToogle() " Write as root cmap w!! w !sudo tee >/dev/null % @@ -75,8 +92,6 @@ function InitPython() map :w map :wa nmap :TagbarOpen fc - - "execute 'NERDTree' endfunction function InitC() -- cgit v1.2.3 From 1f23035b07562b64bb611f48e70080090dcc9bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 14 Sep 2016 08:35:01 +0200 Subject: Add vim-autotag and edit tag usage for vim --- vimrc | 70 +++++++++++++++++++++++-------------------------------------------- 1 file changed, 24 insertions(+), 46 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 11f4203..9325dfe 100644 --- a/vimrc +++ b/vimrc @@ -16,14 +16,7 @@ set undodir=~/.cache/vim-undo// set hlsearch set foldmethod=syntax -" GitGutterEnable - -function InitBase() - set number - set colorcolumn=82 - set textwidth=82 - highlight ColorColumn ctermbg=darkgray -endfunction +colorscheme elflord " Tabs setting. In default we want 4 spaces tab, but allows also 8 spaced tabs set noexpandtab @@ -42,37 +35,50 @@ function TabToogle() set softtabstop=8 echom 'Tab stop set to 8' endif - " Soft tab stop is here only for posibility of expandtab + " Soft tab stop is here only for possibility of expandtab endfunction command TabToogle call TabToogle() " Write as root cmap w!! w !sudo tee >/dev/null % +" netrw configuration cabbrev E Explore +let g:netrw_banner=0 +let g:netrw_liststyle=1 +let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+' +" Some fast buffer switching and opening of new files nnoremap :Explore nnoremap l :bnext nnoremap h :bprev nnoremap :buffers:buffer -let g:netrw_banner=0 -let g:netrw_liststyle=1 -let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+' - -let g:table_mode_corner="|" - -colorscheme elflord " Directory where *.swp files will be stored +" Note that double slash is intensional, it tells vim to build complete path. set directory=$HOME/.cache/vim// " Setup table-mode to markdown compliant " Note: to start use "\ t m" let g:table_mode_corner="|" +set tags=.tags,./tags +" Setup autotag to look for .tags file +let g:autotagTagsFile=".tags" + +" Some fast shortcuts map :call InitBase() +nmap :TagbarOpen fc map :setlocal spell! spelllang=en_us map :setlocal spell! spelllang=cs +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function InitBase() + set number + set colorcolumn=82 + set textwidth=82 + highlight ColorColumn ctermbg=darkgray +endfunction + function InitBash() call InitBase() @@ -91,7 +97,6 @@ function InitPython() unmap map :w map :wa - nmap :TagbarOpen fc endfunction function InitC() @@ -104,40 +109,13 @@ function InitC() map :cp map :cn map :cl - nmap :TagbarOpen fc + + " TODO check if .tags exists and alternativelly generate autocmd BufNewFile,BufRead *.c set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.cpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.h set formatprg=indent\ -kr\ -cp0\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.hpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf - - execute ':silent !ctags -R -f .tags' - autocmd VimLeave * !rm .tags - - execute ':silent !cscope -Rbq -f .cscope.out' - execute 'cscope add .cscope.out' - autocmd VimLeave * !rm .cscope* - - " cscope maping - nmap s :cs find s =expand("") - nmap g :cs find g =expand("") - nmap c :cs find c =expand("") - nmap t :cs find t =expand("") - nmap e :cs find e =expand("") - nmap f :cs find f =expand("") - nmap i :cs find i ^=expand("")$ - nmap d :cs find d =expand("") - nmap s :vert scs find s =expand("") - nmap g :vert scs find g =expand("") - nmap c :vert scs find c =expand("") - nmap t :vert scs find t =expand("") - nmap e :vert scs find e =expand("") - nmap f :vert scs find f =expand("") - nmap i :vert scs find i ^=expand("")$ - nmap d :vert scs find d =expand("") - - - execute ':redraw' endfunction let g:ycm_path_to_python_interpreter="/usr/bin/python3" -- cgit v1.2.3