set nocompatible "https://github.com/tpope/vim-pathogen.git execute pathogen#infect() syntax enable syntax sync fromstart filetype plugin on filetype indent on colorscheme noctu_adapted set encoding=utf-8 set colorcolumn=81 set mouse=a set term=screen set undofile set shiftwidth=4 set tabstop=4 set softtabstop=4 set backspace=indent,eol,start set cindent set history=1000 set showcmd set incsearch set spell set ruler set wrap set breakindent set showbreak=-----> set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣ set tags=./tags,./TAGS,tags,TAGS "set textwidth=80 "set linebreak set nojoinspaces set nrformats+=alpha autocmd BufNewFile,BufRead *.sage set syntax=python autocmd FileType haskell set expandtab autocmd FileType haskell set nospell "autocmd FileType haskell set formatprg=brittany "escape codes for italics set t_ZH= set t_ZR= map cc :cc map gn :bn map gp :bp "map "zyiw :tjump z nmap cp :let @" = "in".expand("%") nnoremap map :!cscope -Rb:cs reset "limit foldtext to 80 characters fu! FoldText() return strcharpart(foldtext(), 1, 80) endf set foldtext=FoldText() set fillchars=fold:\ "check files for changes frequently set autoread set ut=1000 au CursorHold * checktime "highlight own types: au BufRead,BufNewFile *.[ch] let fname = expand(':p:h') . '/types.vim' au BufRead,BufNewFile *.[ch] if filereadable(fname) au BufRead,BufNewFile *.[ch] exe 'so ' . fname au BufRead,BufNewFile *.[ch] endif "https://unix.stackexchange.com/questions/60189/how-to-search-the-current-word-in-all-opened-tabs-in-vim " enables to search in all open buffers with :Search command! -nargs=1 Find call setqflist([]) | silent \ execute "bufdo grepadd! '' %" | redraw! nnoremap :cprevzvzz nnoremap :cnextzvzz "https://stackoverflow.com/questions/9403098/is-it-possible-to-jump-to-the-next-closed-fold-in-vim nnoremap zj :call NextClosedFold('j') nnoremap zk :call NextClosedFold('k') function! NextClosedFold(dir) let cmd = 'norm!z' . a:dir let view = winsaveview() let [l0, l, open] = [0, view.lnum, 1] while l != l0 && open exe cmd let [l0, l] = [l, line('.')] let open = foldclosed(l) < 0 endwhile if open call winrestview(view) endif endfunction "nnoremap zj :call RepeatCmd('call NextClosedFold("j")') "nnoremap zk :call RepeatCmd('call NextClosedFold("k")') "function! RepeatCmd(cmd) range abort " let n = v:count < 1 ? 1 : v:count " while n > 0 " exe a:cmd " let n -= 1 " endwhile "endfunction "https://stackoverflow.com/questions/13634826/show-function-name-in-status-line fun! ShowFuncName() let lnum = line(".") let col = col(".") echohl ModeMsg echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW')) echohl None call search("\\%" . lnum . "l" . "\\%" . col . "c") endfun map :call ShowFuncName() "https://stackoverflow.com/questions/1054701/get-ctags-in-vim-to-go-to-definition-not-declaration if has("cscope") set csto=0 set cst set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb endif " jump to a function declaration nmap :cs find s =expand("")1 " show a list of where function is called nmap :lcs find c =expand("") set cscopequickfix=c+ "nmap :let @+=system("sage -c \"t=var('t');s=var('s');u=var('u');v=var('v');w=var('w');x=var('x');y=var('y');z=var('z');print(latex(".getline('.')."))\"")j nmap :let @+=system("sage -c \"R. = PowerSeriesRing(ZZ);print(latex(".getline('.')."))\"")j """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""" PLUGIN SPECIFIC """"""""""""""""""""""""""""""" runtime ftplugin/man.vim """"""""""""""""""""""""""""""""""" AUTO-MKDIR """"""""""""""""""""""""""""""""" "https://github.com/arp242/auto_mkdir2.vim.git """""""""""""""""""""""""""""""""" VIM-BUFKILL """"""""""""""""""""""""""""""""" "https://github.com/qpkorr/vim-bufkill.git """"""""""""""""""""""""""""""" MULTIPLE SEARCH """"""""""""""""""""""""""""""" "https://www.vim.org/scripts/script.php?script_id=479 """"""""""""""""""""""""""""""" MULTIPLE CURSORS """"""""""""""""""""""""""""""" "https://github.com/terryma/vim-multiple-cursors.git """"""""""""""""""""""""""""""""""" SYNTASTIC """""""""""""""""""""""""""""""""" "https://github.com/vim-syntastic/syntastic.git let g:syntastic_mode_map = {"mode": "active"} let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 0 let g:syntastic_check_on_open = 0 let g:syntastic_check_on_wq = 0 let g:syntastic_auto_jump = 3 let g:syntastic_aggregate_errors = 1 let g:syntastic_enable_highlighting = 0 let g:syntastic_c_include_dirs = ["/usr/include/gtk-3.0"] let g:syntastic_java_checkers = ['checkstyle', 'javac'] let g:syntastic_java_checkstyle_classpath = \ '~/.checkstyle/checkstyle-8.16-all.jar' let g:syntastic_java_checkstyle_conf_file = '~/.checkstyle/checkstyle.xml' let g:syntastic_tex_chktex_args = "-l ~/.chktexrc" let g:syntastic_tex_lacheck_quiet_messages = {"regex": ['.*unmatched.*', \ 'bad character in label.*', 'Do not use @ in LaTeX macro names.']} let g:syntastic_tex_chktex_quiet_messages = \ {"regex": ["`)' expected, found `}'", \ "`}' expected, found `)'"]} let g:syntastic_java_checkstyle_quiet_messages = {"regex": ['Missing a Javadoc comment.']} map :lprev map :lnext autocmd FileType c set formatprg=uncrustify\ -l\ c\ --frag\ -q "https://vim.fandom.com/wiki/Highlight_current_line#Highlighting_that_stays_after_cursor_moves nnoremap h ml:execute 'match Search /\%'.line('.').'l/' """""""""""""""""""""""""""""""""""""" VIMUX """"""""""""""""""""""""""""""""""" "https://github.com/preservim/vimux.git function! REPLsettings(cmd) call VimuxOpenRunner() call VimuxSendText(a:cmd."\n") nmap "vyy:call VimuxSendText(@v)j^ endfunction "autocmd FileType python call REPLsettings("python") "autocmd FileType R call REPLsettings("R") nmap :call VimuxOpenRunner() nmap :call REPLsettings("") """""""""""""""""""""""""""""""""""" DIFFCHAR """""""""""""""""""""""""""""""""" "https://github.com/rickhowe/diffchar.vim.git let g:DiffUnit="Char" """""""""""""""""""""""""""""""""" LATEX SUITE """"""""""""""""""""""""""""""""" "https://github.com/vim-latex/vim-latex set grepprg=grep\ -nH\ $* set modelineexpr "let g:Tex_DefaultTargetFormat = "pdf" "let g:Tex_ViewRule_pdf = "qpdfview" "let g:Tex_CompileRule_pdf = "latexmk -pdf -shell-escape -synctex=1 $*" ""let g:Tex_ViewRule_pdf = "zathura" " "let g:tex_flavor='latex' "let g:Tex_GotoError=0 "let g:tex_comment_nospell=1 "autocmd BufNewFile,BufRead *.tex syntax sync fromstart autocmd BufNewFile,BufRead *.tex set spelllang=en_gb spell autocmd BufNewFile,BufRead *.tex syntax match Comment "%.*" autocmd BufNewFile,BufRead *.tex call TexNewMathZone("M", "align", 1) autocmd BufNewFile,BufRead *.tex set foldtext=FoldText() autocmd BufNewFile,BufRead *.tex set textwidth=80 autocmd BufNewFile,BufRead *.tex let g:syntastic_auto_jump = 0 autocmd BufNewFile,BufRead *.tex set expandtab "imap :let b:Imap_FreezeImap = 1 "imap :let b:Imap_FreezeImap = 0 "imap :w:!biber -E utf8 $(basename % .tex) "nmap :w:!biber -E utf8 $(basename % .tex) " "imap "imap Tex_InsertItemOnThisLine "imap Tex_LeftRight "imap Tex_MathCal "imap Tex_MathBF "map :execute escape(":!qpdfview --quiet --unique $(basename % .tex).pdf $(basename % .tex).pdf#src:%:" . line('.') . ":" . col('.') . " &", '#') map :execute escape(":!okular --unique \"$(basename % .tex).pdf#src:" . line('.') . " %\" &> /dev/null &", '#') nnoremap ll :!latexmk -pdf -shell-escape -synctex=1 % """"""""""""""""""""""""""""""""""""" JAVA """"""""""""""""""""""""""""""""""""" autocmd BufNewFile,BufRead *.java set expandtab autocmd BufNewFile,BufRead *.g4 set expandtab """"""""""""""""""""""""""""""" RAINBOW BRACKETS """"""""""""""""""""""""""""""" "https://github.com/luochen1990/rainbow.git " "\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', "\ 'start=/{/ end=/}/ fold'], let g:rainbow_active = 1 let g:rainbow_conf = { \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], \ 'ctermfgs': ['lightblue', 'lightgreen', 'magenta', 'yellow'], \ 'guis': [''], \ 'cterms': [''], \ 'operators': '_,_', \ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/ fold', \ 'start=/{/ end=/}/ fold'], \ 'separately': { \ '*': {}, \ 'markdown': { \ 'parentheses_options': 'containedin=markdownCode contained', \ }, \ 'lisp': { \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', \ 'darkorchid3'], \ }, \ 'haskell': { \ 'parentheses': ['start=/(/ end=/)/ fold', \ 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'], \ }, \ 'vim': { \ 'parentheses_options': 'containedin=vimFuncBody', \ }, \ 'perl': { \ 'syn_name_prefix': 'perlBlockFoldRainbow', \ }, \ 'stylus': { \ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'], \ }, \ 'css': 0, \ } \} """"""""""""""""""""""""""""""""""" TINY MODE """""""""""""""""""""""""""""""""" "https://www.vim.org/scripts/script.php?script_id=2223 nmap + +ws nmap - -ws nmap > >ws nmap < <ws nn