Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

101 Commits

Repository files navigation

Installation

# Clone repositorycd~
mkdir git
cd git
git clone https://github.com/fuglu/dotvim.git
# Link filescd~
ln -s git/dotvim/vimrc .vimrc
ln -s git/dotvim/vim .vim
# Install plugins
vim +PlugInstall

Plugins

vimrc

" Plugins" =======callplug#begin()
" Editor" ------
Plug 'w0rp/ale'
Plug 'jiangmiao/auto-pairs'
Plug 'gregsexton/MatchTag'
Plug 'scrooloose/nerdcommenter'
Plug 'ervandew/supertab'
Plug 'alvan/vim-closetag'
Plug 'terryma/vim-multiple-cursors'
Plug 'garbas/vim-snipmate'
Plug 'tomtom/tlib_vim'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'honza/vim-snippets'
Plug 'bronson/vim-trailing-whitespace'" Movement" --------
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'mhinz/vim-grepper'
Plug 'ludovicchabant/vim-gutentags'
Plug 'airblade/vim-rooter'" Language Support" ----------------
Plug 'jamessan/vim-gnupg'
Plug 'kamailio/vim-kamailio-syntax'
Plug 'sheerun/vim-polyglot'" Git" ---
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'callplug#end()
" Plugin configuration" ====================" ALE" ---letg:ale_fixers= { 'javascript': ['eslint', 'prettier'] }
" Closetag" --------letg:closetag_filenames="*.html,*.xhtml,*.phtml,*.jsx,*.js,*.tt,*.ejs"" CtrlP" -----letg:ctrlp_match_window='top,max:20,order:ttb'letg:ctrlp_show_hidden=1letg:ctrlp_working_path_mode='ra'" Multiple cursors" ----------------letg:multi_cursor_exit_from_visual_mode=0letg:multi_cursor_exit_from_insert_mode=0" NerdCommenter" -------------let NERDSpaceDelims =1" NerdTree" --------letg:NERDTreeDirArrows=1autocmdbufenter*if (winnr("$") ==1&&exists("b:NERDTree") &&b:NERDTree.isTabTree()) | q | endif" SuperTab" --------letg:SuperTabDefaultCompletionType='<c-n>'" Vim config" ==========setnocompatiblesyntaxonsetbackground=dark
setautowritesethistory=500setignorecasesetincsearchsetrulersetscrolloff=3setshowcmdsetshowmatchsettabpagemax=100setwildmenusetclipboard=" Jump to the last position when reopening a file" -----------------------------------------------auBufReadPost*ifline("'\"") > 0&&line("'\"") <=line("$")
\|exe"normal g'\"" | endif" Highlight tabs" --------------setlistsetlistchars=tab:»·
setlistchars+=trail:·
setlistchars+=extends:>
setlistchars+=precedes:<
" Enable spell checking" ---------------------setspellhighlightclearSpellBadhighlightSpellBadterm=underline cterm=underlinehighlightclearSpellCaphighlightSpellCapterm=underline cterm=underlinehighlightclearSpellRarehighlightSpellRareterm=underline cterm=underlinehighlightclearSpellLocalhighlightSpellLocalterm=underline cterm=underline" Syntax highlighting for unknown file types" ------------------------------------------autocmdBufNewFile,BufRead*.ttsetfhtmlautocmdBufNewFile,BufRead*.phtmlsetfhtmlautocmdBufNewFile,BufRead*.ejssetfhtml" Shortcuts" =========" Switch to next/previous buffer with <Alt-right/left>" ----------------------------------------------------map<a-right>:bn<cr>imap<a-right>:bn<cr>vmap<a-right>:bn<cr>map<a-left>:bp<cr>imap<a-left>:bp<cr>vmap<a-left>:bp<cr>" Step through the program with <Ctrl-j/k/l>" ------------------------------------------map<c-j>�zzmap<c-k>:tnext<cr>map<c-l><C-T>" Search with :grep or <Ctrl-f>" -----------------------------cabbrevgrep<c-r>=(getcmdtype()==':'&&getcmdpos()==1 ? 'Grepper -query' : 'grep')<CR>map<c-f>:Grepper -cword -noprompt<cr>" Open fuzzy finder with <Ctrl-o>" -------------------------------letg:ctrlp_map='<c-o>'letg:ctrlp_cmd='CtrlP .'ifexecutable('ag')
letg:ctrlp_user_command='ag %s -l --nocolor -g ""'letg:ctrlp_use_caching=0endif" Open directory view with <Ctrl-p>" ---------------------------------map<c-p>:NERDTreeToggle<cr>imap<c-p><esc>:NERDTreeToggle<cr>" Jump to next/previous function with <Ctrl-up/down>" --------------------------------------------------autocmdFileTypeperlmap<c-up>?^sub <cr>zzautocmdFileTypeperlimap<c-up><esc>?^sub <cr>zzautocmdFileTypeperlmap<c-down>/^sub <cr>zzautocmdFileTypeperlimap<c-down><esc>/^sub <cr>zzautocmdFileTypephp,javascriptmap<c-up>?function <cr>zzautocmdFileTypephp,javascriptimap<c-up><esc>?function <cr>zzautocmdFileTypephp,javascriptmap<c-down>/function <cr>zzautocmdFileTypephp,javascriptimap<c-down><esc>/function <cr>zzautocmdFileTypepythonmap<c-up>?^def <cr>zzautocmdFileTypepythonimap<c-up><esc>?^def <cr>zzautocmdFileTypepythonmap<c-down>/^def <cr>zzautocmdFileTypepythonimap<c-down><esc>/^def <cr>zz" Move lines up/down with <Alt-up/down>" -------------------------------------nnoremap<a-up>:m .-2<CR>==nnoremap<a-down>:m .+1<CR>==inoremap<a-up><Esc>:m .-2<CR>==giinoremap<a-down><Esc>:m .+1<CR>==givnoremap<a-up>:m '<-2<CR>gv=gvvnoremap<a-down>:m '>+1<CR>gv=gv" Re factor with <R/L/K>" ----------------------letg:multi_cursor_next_key='R'letg:multi_cursor_prev_key='L'letg:multi_cursor_skip_key='K'" Start multiple cursors with <Ctrl-m>" ------------------------------------vmap<c-m>R" Insert debug code with <Ctrl-d>" -------------------------------autocmdFileTypecimap<c-d>printf("%s\n", );<left><left>autocmdFileTypejavaimap<c-d>System.out.println();<left><left>autocmdFileTypejavascriptimap<c-d>console.log();<left><left>autocmdFileTypeperlimap<c-d>print Dumper $;<left>autocmdFileTypephpimap<c-d>var_dump($);<left><left>autocmdFileTypepythonimap<c-d>import sys; print >> sys.stderr,<space>" Toggle git blame view with <Ctrl-b>" -----------------------------------map<c-b>:Gblame<cr>imap<c-b><esc>:Gblame<cr>" Toggle git status view with <Ctrl-g>" ------------------------------------map<c-g>:Gstatus<cr>imap<c-g><esc>:Gstatus<cr>" Fix spelling with <Ctrl-s>" --------------------------map<c-s>z=imap<c-s><esc>z=" Write a file using sudo with :w!!" ---------------------------------cmapw!!w !sudo tee % >/dev/null" Toggle paste mode with <F5>" ---------------------------setpastetoggle=<F5>" Toggle comment with <F8>" ------------------------map<F8><leader>c<space>vmap<F8><leader>c<space>imap<F8><esc><leader>c<space>" Toggle indentation with <F11>" -----------------------------functionTabToggle()
if &expandtabsetshiftwidth=8setsofttabstop=0setnoexpandtabelsesetshiftwidth=2setsofttabstop=2setexpandtabendifendfunctionmap<F11>mz:execute TabToggle()<CR>'zvmap<F11>mz:execute TabToggle()<CR>'zimap<F11><esc>mz:execute TabToggle()<CR>'zi" Reformat file with <F12>" ------------------------map<F12>:ALEFix<cr>vmap<F12>:ALEFix<cr>imap<F12><esc>:ALEFix<cr>i

🎉

About

Vim configuration with 💥 and 🎉

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages