let g:pathogen_disabled = ['ctrlp', 'ctrlp-funky', 'vim-sneak', 'CoVim', 'neocomplcache', 'neocomplcache-ultisnips'] if has("win32") || has("win64") " Required by pathogen.vim for loading plugins call pathogen#infect() "Required by vim-latex on windows machines set shellslash "Otherwise vim will try to write temp files in sys32 folder when editing new file set directory=.,$TEMP else call pathogen#infect('~/.vim/bundle') " Unless we're in gvim, set up colors if !has("gui_running") set t_Co=256 colorscheme liquorice-approx end end " Fix for my shell, otherwise some scripts break if $SHELL =~ 'bin/fish' set shell=/bin/sh endif " Automatic commands if has("autocmd") augroup MyAutoCmd " Automatically load vimrc when it is saved autocmd bufwritepost .vimrc source $MYVIMRC autocmd BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc \ so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif " Mapping for checking for existing mappings in vimrc autocmd BufEnter .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc \ nnoremap ' /leader> " Set ghc as compiler for haskell files autocmd BufEnter *.hs compiler ghc " Disable foldcolumn in diff windows au FilterWritePre * if &diff | setlocal fdc=0 | endif " Disable things that disturb diff-colors in diff window au FilterWritePre * if &diff | setlocal nocursorcolumn | endif au FilterWritePre * if &diff | setlocal nocursorline | endif au FilterWritePre * if &diff | IndentGuidesDisable | endif endif " :Configure to edit this file in a split window command! Configure edit $MYVIMRC command! SConfigure split $MYVIMRC command! VConfigure vsplit $MYVIMRC " :Cdpwd to set current window's pwd to the edited file's directory command! Cdpwd lcd %:p:h " :Q to quit command! Q q command! Qall qall """"""""""""""""""""""""""""""""" "" Basic settings "" syntax enable " Enables syntax highlighting with custom colors filetype plugin indent on " React on filetypes with plugins and syntax set scrolloff=4 " Minimum number of lines to display around cursor set autoread " Files changed from outside are automatically reread set hlsearch " Highlight search results set mousehide " Hide the mouse when typing text set smarttab " inserts 'shiftwidth' spaces set shiftwidth=4 " Amount of spaces for tab to insert set autoindent " Automatically set the indent when creating new lines. set showcmd " Shows current command in statusline set ruler " Show cursor position information in statusline set relativenumber " Show relative line numbers by default set number " Show absolute line number of current line set wrap " Wrap text set ttyfast " 'Smooth' scrolling set showmatch " Briefly display matching brackets when inserting such. set incsearch " Incremental searching as soon as typing begins. set ignorecase " Ignores case when searching set smartcase " Will override ignorecase if searching w/ diff cases. set modeline " Use moelines set expandtab " Makes insert spaces in insert mode set wildchar= " Key that triggers command-line expansion. set wildmenu set wildmode=longest:full set noerrorbells " Disables beeping. set hidden " Allow switch buffer without saving set previewheight=15 " Height of the preview window "set winwidth=80 " Current window will be resized to this width set switchbuf=useopen " If switching to a buffer that is already open, go " to where it is already open instead of here. set backspace=indent,eol,start whichwrap+=<,>,[,] "backspace functionality set formatprg=par " user par to format text with the gq command set formatoptions=croqlj " auto formatting options " c - autowrap using textwidth " r - autoinsert comment leader on i_ " q - allow formatting of comments with gq " l - long lines aren't broken " j - remove comment leader when joining lines set noea " prevent equalizing of split sizes on closed split set fillchars=fold:\ ,vert:\ " fill characters for fold lines and lines between vsplits set ttimeoutlen=50 " Faster twitchin' for everything " Completion ignores " KEEP THESE IN SYNC WITH UNITE IGNORES! set wildignore+=*/.hg/*,*/.svn/*,*.pyc,*.class set wildignore+=.ropeproject/** set wildignore+=log/** set wildignore+=tmp/** set wildignore+=obj/** " Ignore output and VCS files: Note: do not ignore .git! It breaks fugitive's :Gdiff set wildignore+=*.o,*.out,*.obj,*.rbc,*.rbo,*.class,.svn,*.gem " Ignore archive files set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz " Ignore image files set wildignore+=*.jpg,*.jpeg,*.bmp,*.png,*.gif " Ignore bundler and sass cache set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/* " Ignore rails temporary asset caches set wildignore+=*/tmp/cache/assets/*/sprockets/*,*/tmp/cache/assets/*/sass/* " Ignore node modules set wildignore+=node_modules/* " Ignore temp and backup files set wildignore+=*.swp,*~,._* """"""""""""""""""""""""""""""""""""""""""""" "" Settings for specific filetypes "" if has("autocmd") au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4 au FileType javascript setlocal expandtab shiftwidth=2 softtabstop=2 au BufNewFile,BufReadPost *.coffee setlocal foldmethod=indent shiftwidth=2 softtabstop=2 expandtab au BufWritePost,FileWritePost *.coffee silent make! au FileType c setlocal colorcolumn=79 au FileType {make,gitconfig} set noexpandtab sw=4 au QuickFixCmdPost * nested cwindow | redraw! endif """"""""""""""""""""""""""""""""""""""""""""" "" Status line stuff "" set laststatus=2 " always show status line " Returns current file encoding. " Currently used for status line. function! FileEncoding() if &fileencoding == '' return "NONE" else return &fenc endif endfunction set statusline=%<%F\ %m%r%h%w%{fugitive#statusline()}\ %Y\ %{FileEncoding()}\ %{&ff}%=%#warningmsg#%{SyntasticStatuslineFlag()}%*\ %c\,\ %l/%L\ %p%%\ " < truncation point " F full path to file " m modified marker " r read-only flag " h help buffer flag " w preview window flag " {fug..Shows branch if file is in git repo " Y file type " {&ff} output of command ff (file format) " {FileEncoding} function defined above " = split point for left/rigth justification " #warningmsg# no idea " {SyntasticStatuslineFlag()} syntax error stuff from syntastic " * no idea " c column number " l line number " L total line numbers " p percentage through file (in lines as CTRL-G " change status line colour if it is in insert mode if version >= 700 au InsertEnter * hi StatusLine gui=NONE guifg=#FFFFFF guibg=#9D3569 au InsertLeave * hi StatusLine gui=NONE guifg=#d6d6d6 guibg=#602040 endif """"""""""""""""""""""""""""""""""""""""""""" "" Session information, what to remember. Used with :mksession to save "" and restore sessions as if you never quit vim. I used this before the "" times of never shutting down my PC. Still useful at work and on laptops. set viminfo='1000,f1,<1000,:500,@500,/500,! " ' Max number of previously edited files for which marks are " remembered " f remember marks " < max number of lines saved per register " : max items in commandline history " @ max items in input-line history to be saved " / max items in search pattern history set ssop=blank,buffers,sesdir,folds,help,options,tabpages,winsize,resize " Enables saving and restoring " blank empty windows " buffers hidden and unloaded buffers " sesdir makes the current directory the one the session file is in " folds manually created folds, opened/closed folds and local fold opt " help the help window " options all options and mappings (also global vals for local opts) " tabpages all tab pages instead of only the current one " winsize window sizes (the windows inside vim) " resize size of the vim window, lines and columns """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "" Recovery, recover a file then write :DiffOrig to see "" a vimdiff between the recovery and the original. command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "" Spell checking "" " Pressing ff will toggle and untoggle spell checking, " fe sets checking to english and fs sets checking to swedish. nnoremap ff :setlocal spell! nnoremap fs :setlocal spelllang=sv nnoremap fe :setlocal spelllang=en "go to next error nnoremap fn ]s "go to previous error nnoremap fp [s "add to spellfile nnoremap fa zg "suggest correct words nnoremap f? z= """""""""""""""""""""""""""""""""""""""""""""""""" "" Fugitive settings and bindings "" https://github.com/tpope/vim-fugitive "" " Maps .. to go up one level from fugitive blob and tree views autocmd User fugitive \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' | \ nnoremap .. :edit %:h | \ endif nnoremap .. :edit %:h " Automatically delete hidden fugitive buffers autocmd BufReadPost fugitive://* set bufhidden=delete """""""""""""""""""""""""""""""""""""""""""""""""" "" vim-space configuration "" http://github.com/jfelchner/vim-space "" let g:space_no_buffers = 1 let g:space_no_tabs = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" Gist configuration "" https://github.com/mattn/gist-vim "" let g:gist_clip_command = 'xsel --clipboard -i' let g:gist_detect_filetype = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" Unite configuration "" " Fuzzy match by default call unite#filters#matcher_default#use(['matcher_fuzzy']) call unite#filters#sorter_default#use(['sorter_rank']) " Fuzzy matching for plugins not using matcher_default as filter call unite#custom#source('outline,line,grep,session', 'filters', ['matcher_fuzzy']) " Ignore some things " KEEP THESE IN SYNC WITH WILDIGNORE! " Need to escape dots in the patterns! call unite#custom#source('file_rec,file_rec/async,file_mru,file,buffer,grep', \ 'ignore_pattern', join([ \ '\.swp', '\.swo', '\~$', \ '\.git/', '\.svn/', '\.hg/', \ '\.ropeproject/', \ 'node_modules/', 'log/', 'tmp/', 'obj/', \ '/vendor/gems/', '/vendor/cache/', '\.bundle/', '\.sass-cache/', \ '/tmp/cache/assets/.*/sprockets/', '/tmp/cache/assets/.*/sass/', \ '\.pyc$', '\.class$', '\.jar$', \ '\.jpg$', '\.jpeg$', '\.bmp$', '\.png$', '\.gif$', \ '\.o$', '\.out$', '\.obj$', '\.rbc$', '\.rbo$', '\.gem$', \ '\.zip$', '\.tar\.gz$', '\.tar\.bz2$', '\.rar$', '\.tar\.xz$' \ ], '\|')) " Situate on bottom or right by default let g:unite_split_rule = "botright" " Keep track of yanks let g:unite_source_history_yank_enable = 1 " Prettier prompt let g:unite_prompt = '» ' " Faster update time after keypresses let g:unite_update_time = 200 " Always start in insert mode let g:unite_enable_start_insert = 1 " Autosave sessions for unite-sessions let g:unite_source_session_enable_auto_save = 1 " Non-ugly colors for selected item, requires you to set 'hi UnitedSelectedLine' let g:unite_cursor_line_highlight = "UniteSelectedLine" " Set to some better time formats let g:unite_source_buffer_time_format = " %Y-%m-%d %H:%M:%S " let g:unite_source_file_mru_time_format = " %Y-%m-%d %H:%M:%S " " Use ag or ack as grep command if possible if executable('ag') let g:unite_source_grep_command = 'ag' let g:unite_source_grep_default_opts = '--nocolor --nogroup --hidden --ignore-case' let g:unite_source_grep_recursive_opt = '' elseif executable('ack-grep') let g:unite_source_grep_command = 'ack-grep' let g:unite_source_grep_default_opts = \ '--no-heading --no-color -a -H' let g:unite_source_grep_recursive_opt = '' endif " Bindings nnoremap l :Unite -buffer-name=ultisnips -vertical ultisnips nnoremap lr :Unite -buffer-name=files file_rec/async file/new nnoremap le :Unite -buffer-name=files file_mru bookmark file_rec/async file/new nnoremap lb :Unite -buffer-name=buffers buffer nnoremap ly :Unite -buffer-name=yanks history/yank nnoremap lc :Unite -buffer-name=changes change nnoremap lj :Unite -buffer-name=jumps jump nnoremap lf :Unite -buffer-name=jumps jump nnoremap l; :Unite -buffer-name=commands history/command nnoremap l/ :Unite -buffer-name=commands history/search nnoremap lo :Unite -buffer-name=outline outline nnoremap la :Unite -buffer-name=outline -vertical outline nnoremap ll :Unite -buffer-name=line line nnoremap lq :Unite -buffer-name=quickfix quickfix nnoremap lw :Unite -buffer-name=location_list location_list nnoremap l* :UniteWithCursorWord -buffer-name=line line nnoremap lg :Unite -buffer-name=grep grep nnoremap ls :Unite session nnoremap lt :Unite -buffer-name=tags tag tag/file nnoremap li :Unite -buffer-name=included_tags tag/include nnoremap ld :Unite -buffer-name=change-cwd -default-action=lcd directory_mru directory nnoremap l, :UniteResume nnoremap lv :UniteResume nnoremap lV :UniteResume nnoremap lS :UniteSessionSave autocmd FileType unite call s:unite_my_settings() function! s:unite_my_settings() "Keymaps inside the unite split nmap d (unite_exit) nmap (unite_exit) imap (unite_exit) nnoremap (unite_select_next_line) nnoremap (unite_select_previous_line) inoremap unite#do_action('split') nnoremap unite#do_action('split') inoremap unite#do_action('vsplit') nnoremap unite#do_action('vsplit') endfunction """""""""""""""""""""""""""""""""""""""""""""""""" "" Tagbar configuration "" nnoremap tt :TagbarToggle nnoremap tg :TagbarOpen fj let g:tagbar_compact = 1 let g:tagbar_width = 40 """""""""""""""""""""""""""""""""""""""""""""""""" "" Vim-latex bindings "" vim-latex.org "" set grepprg=grep\ -nH\ $* let g:Tex_DefaultTargetFormat = 'pdf' let g:tex_flavor='latex' let g:Tex_SmartKeyQuote=0 let g:Tex_MultipleCompileFormats = 'dvi,pdf' nnoremap ,g :execute "!makeglossaries " . shellescape(expand('%:r'), 1) """""""""""""""""""""""""""""""""""""""""""""""""" "" Rainbow-Parentheses-Improved-and2 settings "" http://github.com/vim-scripts/Rainbow-Parentheses-Improved-and2 "" let g:rainbow_ctermfgs = [184, 39, 170, 162, 154, 9, 10, 11, 13, 14, 15] let g:rainbow_active = 1 let g:rainbow_operators = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" togglelist settings "" https://github.com/xaimus/vim-togglelist "" nnoremap A :Ltoggle nnoremap q :Ctoggle """""""""""""""""""""""""""""""""""""""""""""""""" "" neocomplete.vim completion "" http://github.com/Shougo/neocomplete.vim "" let g:neocomplete#enable_at_startup = 1 if !exists('g:neocomplete#sources#omni#functions') let g:neocomplete#sources#omni#functions = {} endif if !exists('g:neocomplete#force_omni_input_patterns') let g:neocomplete#force_omni_input_patterns = {} endif let g:neocomplete#force_overwrite_completefunc = 1 inoremap neocomplete#undo_completion() inoremap neocomplete#complete_common_string() " To complete in python with jedi-vim let g:jedi#completions_enabled = 0 let g:jedi#auto_vim_configuration = 0 let g:neocomplete#force_omni_input_patterns.python = \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' " To complete in c++ with clang_complete let g:neocomplete#force_omni_input_patterns.c = \ '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplete#force_omni_input_patterns.cpp = \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' let g:neocomplete#force_omni_input_patterns.objc = \ '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplete#force_omni_input_patterns.objcpp = \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " : close popup and save indent. inoremap =my_cr_function() function! s:my_cr_function() return neocomplete#close_popup() . "\" " For no inserting key. "return pumvisible() ? neocomplete#close_popup() : "\" endfunction """""""""""""""""""""""""""""""""""""""""""""""""" "" neocomplcache completion "" http://github.com/Shougo/neocomplcache "" " if !exists('g:neocomplcache_omni_functions') " let g:neocomplcache_omni_functions = {} " endif " if !exists('g:neocomplcache_force_omni_patterns') " let g:neocomplcache_force_omni_patterns = {} " endif "let g:neocomplcache_force_overwrite_completefunc = 1 " let g:neocomplcache_enable_at_startup = 1 " let g:neocomplcache_enable_fuzzy_completion = 1 " inoremap neocomplcache#undo_completion() " inoremap neocomplcache#complete_common_string() " To complete in python with jedi-vim " let g:neocomplcache_force_omni_patterns['python'] = '[^. t].w*' " let g:neocomplcache_omni_functions['python'] = 'jedi#completions' " To complete in c++ with clang_complete " let g:neocomplcache_force_omni_patterns.c = " \ '[^.[:digit:] *\t]\%(\.\|->\)' " let g:neocomplcache_force_omni_patterns.cpp = " \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " let g:neocomplcache_force_omni_patterns.objc = " \ '[^.[:digit:] *\t]\%(\.\|->\)' " let g:neocomplcache_force_omni_patterns.objcpp = " \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " Fix behaviour " function! s:my_cr_function() " return neocomplcache#smart_close_popup() . "\" " " For no inserting key. " "return pumvisible() ? neocomplcache#close_popup() : "\" " endfunction " inoremap =my_cr_function() """""""""""""""""""""""""""""""""""""""""""""""""" "" jedi-vim "" " play nice with neocomplcache let g:jedi#auto_initialization = 1 let g:jedi#auto_vim_configuration = 0 let g:jedi#popup_on_dot = 0 let g:jedi#goto_assignments_command = "jg" let g:jedi#goto_definitions_command = "jd" let g:jedi#documentation_command = "K" let g:jedi#usages_command = "ju" let g:jedi#completions_command = "jc" let g:jedi#rename_command = "jr" let g:jedi#show_call_signatures = "1" autocmd FileType python setlocal omnifunc=jedi#complete autocmd FileType python let b:did_ftplugin = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" vim-sparkup settings "" let g:sparkupExecuteMapping = 'v' let g:sparkupNextMapping = 'b' """""""""""""""""""""""""""""""""""""""""""""""""" "" python-mode, ropevim settings "" let g:pymode_rope_extended_autocomplete=1 let g:pymode_rope_autoimport_modules = ["os", "django.*"] let g:pymode_lint = 0 """""""""""""""""""""""""""""""""""""""""""""""""" "" Settings for misc plugins "" let g:gist_detect_filetype = 1 let g:UltiSnipsEditSplit = 'horizontal' let g:UltiSnipsExpandTrigger = '' let g:UltiSnipsJumpForwardTrigger = '' let g:UltiSnipsJumpBackwardTrigger = '' let g:UltiSnipsUsePythonVersion = 2 let g:maximizer_set_default_mapping = 0 """""""""""""""""""""""""""""""""""""""""""""""""" "" Settings for syntastic "" let g:syntastic_error_symbol = '✗✗' let g:syntastic_warning_symbol = '⚠⚠' let g:syntastic_style_error_symbol = '✠✠' let g:syntastic_style_warning_symbol = '≈≈' let g:syntastic_enable_balloons = 0 let g:syntastic_auto_loc_list = 0 let g:syntastic_loc_list_height = 6 let g:syntastic_always_populate_loc_list = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_python_checkers = ['flake8'] let g:syntastic_coffee_coffeelint_args = '-f ~/.config/coffeelint.json' let g:syntastic_c_config_file = '.clang_complete' let g:syntastic_cpp_config_file = '.clang_complete' let g:syntastic_java_javac_config_file_enabled = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" Settings for clang_complete "" let g:clang_complete_auto = 0 let g:clang_auto_select = 0 let g:clang_snippets = 1 " let g:clang_snippets_engine = 'ultisnips' let g:clang_use_library = 1 let g:clang_complete_macros = 1 "let g:clang_user_options = '|| exit 0' """""""""""""""""""""""""""""""""""""""""""""""""" "" Settings for vim-indent-guides "" let g:indent_guides_auto_colors = 0 let g:indent_guides_guide_size = 1 let g:indent_guides_start_level = 2 let g:indent_guides_enable_on_vim_startup = 1 """""""""""""""""""""""""""""""""""""""""""""""""" "" Settings for haskellmode-vim "" let g:haddock_browser = "/usr/bin/google-chrome" let g:ghc = "/usr/bin/ghc" """""""""""""""""""""""""""""""""""""""""""""""""" "" In visual mode you press * or # to search for the current selection "" vnoremap * :call VisualSearch('f') vnoremap # :call VisualSearch('b') function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo endfunction " From an idea by Michael Naumann function! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_reg endfunction """""""""""""""""""""""""""""""""""""""""""""""""" "" Opens a preview window which looks at the ctags definition "" of whichever word your cursor is currently over. Sweet "" " :func! PreviewWord() " : if &previewwindow " don't do this in the preview window " : return " : endif " : let w = expand("") " get the word under cursor " : if w =~ '\a' " if the word contains a letter " : " : " Delete any existing highlight before showing another tag " : silent! wincmd P " jump to preview window " : if &previewwindow " if we really get there... " : match none " delete existing highlight " : wincmd p " back to old window " : endif " : " : " Try displaying a matching tag for the word under the cursor " : try " : exe "ptag " . w " : catch " : return " : endtry " : " : silent! wincmd P " jump to preview window " : if &previewwindow " if we really get there... " : if has("folding") " : silent! .foldopen " don't want a closed fold " : endif " : call search("$", "b") " to end of previous line " : let w = substitute(w, '\\', '\\\\', "") " : call search('\<\V' . w . '\>') " position cursor on match " : " Add a match highlight to the word at this position " : hi previewWord term=bold ctermbg=green guibg=green " : exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"' " : wincmd p " back to old window " : endif " : endif " :endfun """""""""""""""""""""""""""""""""""""""""""""""""" "" Keymaps "" " Toggle colorcolumn TODO make this save previous value " instead of using 79 all the time. function! g:ToggleColorColumn() if &colorcolumn != '' setlocal colorcolumn& else setlocal colorcolumn=79 endif endfunction nnoremap cc :call g:ToggleColorColumn() " Pull word under cursor into LHS of a substitute nnoremap z :%s#\<=expand("")\>##gc nnoremap Z :bufdo %s#\<=expand("")\>##gceupdate " move between windows nnoremap j nnoremap k nnoremap h nnoremap l " make window 40 chars wide, useful for CSS files nnoremap 4 :vertical resize 40 " change buffers with ctrl-n and ctrl-p nnoremap :BufSurfBack nnoremap :BufSurfForward " Shows the ctags definition of keyword under " the cursor in a preview window "map :call PreviewWord() " Closes the preview window "map [ z " Use up and down keys to scroll up and down nmap 3 nmap 3 nmap 10zh nmap 10zl " Bash-like keys for the command line cnoremap cnoremap cnoremap cnoremap cnoremap " Move up and down in autocomplete with and inoremap ("\") inoremap ("\") " Indent the entire file nnoremap = gg=G`' " Drag current line(s) up/down noremap j :m+ noremap k :m-2 inoremap j :m+ inoremap k :m-2 vnoremap j :m'>+gv vnoremap k :m-2gv " Ctrl-h for next line + " Ctrl-o for next line " ;a for inoremap o inoremap o noremap ;a inoremap ;a "Like D for yanking map Y y$ " Copy/Paste with os buffer map y "+y map Y "+y$ nmap p "+p nmap P "+P " Copy current file path into os buffer command! Ypwd let @+ = expand("%:p") nnoremap fy :Ypwd " Save, quit, etc nnoremap s :w nnoremap w :wa nnoremap x :wq nnoremap d :q nnoremap c :qa nnoremap h :FSHere nnoremap hh :FSHere nnoremap hu :FSSplitAbove nnoremap hl :FSSplitLeft " Maximize buffer toggling nnoremap :MaximizerToggle vnoremap :MaximizerTogglegv inoremap :MaximizerToggle " w!! -> write even if you forgot sudo cmap w!! w !sudo tee >/dev/null % " Disable Ex mode map Q " Mappings to interact with fugitive nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gb :Gblame nnoremap gw :Gwrite nnoremap gh :Git hub nnoremap gH :Git buh nnoremap gp :Git push nnoremap gl :Glog nnoremap gg :Ggrep nnoremap gc :Gcommit -m ' nnoremap gA :Git checkout -- % " Misc mappings nnoremap i la h nnoremap < :noh nnoremap e :UltiSnipsEdit nnoremap u :UndotreeToggle nnoremap m :w:make nnoremap a :sign unplace *:Lclose " Accidentally pressing F1 is to press ESC map imap cmap xmap smap lmap