Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " vim: set foldmethod=marker foldlevel=0 nomodeline:
- " Plugins {{{
- " -----------------------------------------------------------------------------
- " Specify a directory for plugins.
- call plug#begin('~/.vim/bundle')
- " Gruvbox theme.
- Plug 'gruvbox-community/gruvbox'
- " Integrate fzf with Vim.
- Plug '~/.fzf'
- Plug 'junegunn/fzf', { 'do': './install --all' }
- Plug 'junegunn/fzf.vim'
- " Better manage Vim sessions.
- Plug 'tpope/vim-obsession'
- " Zoom in and out of a specific split pane (similar to tmux).
- Plug 'dhruvasagar/vim-zoom'
- " Pass focus events from tmux to Vim (useful for autoread and linting tools).
- Plug 'tmux-plugins/vim-tmux-focus-events'
- " Navigate and manipulate files in a tree view.
- Plug 'scrooloose/nerdtree'
- " Helpers for moving and manipulating files / directories.
- Plug 'tpope/vim-eunuch'
- " Launch Ranger from Vim.
- Plug 'francoiscabrol/ranger.vim'
- " Run a diff on 2 directories.
- Plug 'will133/vim-dirdiff'
- " Run a diff on 2 blocks of text.
- Plug 'AndrewRadev/linediff.vim'
- " Add spelling errors to the quickfix list (vim-ingo-library is a dependency).
- Plug 'inkarkat/vim-ingo-library' | Plug 'inkarkat/vim-SpellCheck'
- " Briefly highlight which text was yanked.
- Plug 'machakann/vim-highlightedyank'
- " Modify * to also work with visual selections.
- Plug 'nelstrom/vim-visual-star-search'
- " Automatically clear search highlights after you move your cursor.
- Plug 'haya14busa/is.vim'
- " Handle multi-file find and replace.
- Plug 'mhinz/vim-grepper'
- " Better display unwanted whitespace.
- Plug 'ntpeters/vim-better-whitespace'
- " Toggle comments in various ways.
- Plug 'tpope/vim-commentary'
- " Automatically set 'shiftwidth' + 'expandtab' (indention) based on file type.
- Plug 'tpope/vim-sleuth'
- " A number of useful motions for the quickfix list, pasting and more.
- Plug 'tpope/vim-unimpaired'
- " Drastically improve insert mode performance in files with folds.
- Plug 'Konfekt/FastFold'
- " Show git file changes in the gutter.
- "Plug 'mhinz/vim-signify'
- " A git wrapper.
- Plug 'tpope/vim-fugitive'
- " Dim paragraphs above and below the active paragraph.
- Plug 'junegunn/limelight.vim'
- " Distraction free writing by removing UI elements and centering everything.
- Plug 'junegunn/goyo.vim'
- " A bunch of useful language related snippets (ultisnips is the engine).
- Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
- " Run test suites for various languages.
- Plug 'janko/vim-test'
- "C family languages completion
- Plug 'Valloric/YouCompleteMe'
- " IDE-like bar
- Plug 'bagrat/vim-buffet'
- " Languages and file types.
- Plug 'cakebaker/scss-syntax.vim'
- Plug 'chr4/nginx.vim'
- Plug 'chrisbra/csv.vim'
- Plug 'ekalinin/dockerfile.vim'
- Plug 'elixir-editors/vim-elixir'
- Plug 'Glench/Vim-Jinja2-Syntax'
- Plug 'godlygeek/tabular' | Plug 'tpope/vim-markdown'
- Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
- Plug 'lifepillar/pgsql.vim'
- Plug 'othree/html5.vim'
- Plug 'pangloss/vim-javascript'
- Plug 'PotatoesMaster/i3-vim-syntax'
- Plug 'stephpy/vim-yaml'
- Plug 'tmux-plugins/vim-tmux'
- "Plug 'tpope/vim-git'
- Plug 'tpope/vim-liquid'
- Plug 'tpope/vim-rails'
- Plug 'vim-python/python-syntax'
- Plug 'vim-ruby/vim-ruby'
- Plug 'wgwoods/vim-systemd-syntax'
- "Plug 'psf/black'
- call plug#end()
- " }}}
- " leader {{{
- " -----------------------------------------------------------------------------
- let mapleader=";"
- "noremap <leader><leader> <C-^>
- noremap <leader>cc :<ESC>gg"+yG<ESC>
- noremap <leader>y yiW
- " }}}
- " General Config {{{
- " -----------------------------------------------------------------------------
- set backspace=indent,eol,start "Allow backspace in insert mode
- set showcmd "Show incomplete cmds down the bottom
- set showmode "Show current mode down the bottom
- set gcr=a:blinkon0 "Disable cursor blink
- set visualbell "No sounds
- set autoread "Reload files changed outside vim
- set hidden
- set cursorline
- set modeline
- set mouse=n
- set encoding=utf-8
- set isfname+=32
- set showmatch "highlight matching [{{{()}}}]
- set lazyredraw
- set tw=100
- set complete+=kspell
- "set colorcolumn=100
- set formatoptions=tcqrn1
- set matchpairs+=<:> " Use % to jump between pairs
- set nocompatible
- set noerrorbells visualbell t_vb=
- set noshiftround
- set nospell
- set nostartofline
- set regexpengine=1
- set ruler
- set ttimeout
- set whichwrap=b,s,<,>
- set t_Co=256
- set title titlestring=
- set completeopt-=preview
- set splitbelow
- set splitright
- " }}}
- " history, undo and backup {{{
- " -----------------------------------------------------------------------------
- set history=1000
- set undofile
- set undodir=~/.vim/undo
- set undolevels=1000
- set undoreload=10000
- set backupdir=~/.vim/backup
- set directory=~/.vim/backup
- set viminfo='100000
- " }}}
- " Scrolling {{{
- " -----------------------------------------------------------------------------
- set scrolloff=8 "Start scrolling when we're 8 lines away from margins
- set sidescrolloff=0
- set sidescroll=0
- "set grepprg=grep\ -nH\ $*
- set runtimepath+=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
- " }}}
- " Folds and search {{{
- " -----------------------------------------------------------------------------
- " set foldenable " enable folding
- " set foldlevelstart=0 " open most folds by default
- " set foldnestmax=10 " 10 nested fold max
- " set foldmethod=marker " fold based on marker
- " toggle folding
- nnoremap <space> za
- " unfold all
- nnoremap <F7> zR
- " fold all
- nnoremap <F8> :foldc!<CR>
- " Search
- set incsearch " Find the next match as we type the search
- set hlsearch " Highlight searches by default
- set ignorecase " Ignore case when searching...
- set smartcase " ...unless we type a capital
- " }}}
- " relative numbers, TOP bar, statusline {{{
- " -----------------------------------------------------------------------------
- nnoremap <silent><leader>l :set number! relativenumber!<CR>
- "augroup numbertoggle
- " autocmd!
- " autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
- " autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
- "augroup END
- "
- " status line and top bar
- " IDE BAR
- nnoremap <silent><leader>k :execute 'set showtabline=' . (&showtabline ==# 2 ? 0 : 2)<CR>
- " status line
- "
- "set statusline=" %F%m%r%h %w CWD: %r%{getcwd()}%h Line: %1"
- set laststatus=1
- " }}}
- "alphsubs ---------------------- {{{
- " execute "digraphs ks " . 0x2096
- " execute "digraphs as " . 0x2090
- " execute "digraphs es " . 0x2091
- " execute "digraphs hs " . 0x2095
- " execute "digraphs is " . 0x1D62
- " execute "digraphs ks " . 0x2096
- " execute "digraphs ls " . 0x2097
- " execute "digraphs ms " . 0x2098
- " execute "digraphs ns " . 0x2099
- " execute "digraphs os " . 0x2092
- " execute "digraphs ps " . 0x209A
- " execute "digraphs rs " . 0x1D63
- " execute "digraphs ss " . 0x209B
- " execute "digraphs ts " . 0x209C
- " execute "digraphs us " . 0x1D64
- " execute "digraphs vs " . 0x1D65
- " execute "digraphs xs " . 0x2093
- "}}}
- " arabic/english {{{
- " Switch to English - mapping
- "nnoremap <Leader>z :<C-U>call EngType()<CR>
- " Switch to Arabic - mapping
- "nnoremap <Leader>a :<C-U>call AraType()<CR>
- " Switch to English - function
- function! EngType()
- " To switch back from Arabic
- set norightleft
- endfunction
- " Switch to Arabic - function
- function! AraType()
- set rightleft
- set arabicshape
- set arabic
- endfunction
- au BufNewFile,BufRead *.txt call ConfigureTxtFile()
- func! ConfigureTxtFile()
- setlocal spell spelllang=en_us
- set wrapmargin=80
- set textwidth=80
- endfunction
- " }}}
- " Indentation {{{
- set cindent
- set autoindent
- set smartindent
- set smarttab
- set shiftwidth=4
- set softtabstop=4
- set tabstop=4
- set expandtab smarttab
- set shiftround
- " Auto indent pasted text
- nnoremap p p=`]<C-o>
- nnoremap P P=`]<C-o>
- filetype plugin on
- filetype indent on
- " Display tabs and trailing spaces visually
- set list listchars=tab:\ \ ,trail:·
- set nowrap "Don't wrap lines
- " }}}
- " Completion {{{
- set wildmode=list:longest
- set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
- set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
- set wildignore+=*vim/backups*
- set wildignore+=*sass-cache*
- set wildignore+=*DS_Store*
- set wildignore+=vendor/rails/**
- set wildignore+=vendor/cache/**
- set wildignore+=*.gem
- set wildignore+=log/**
- set wildignore+=tmp/**
- set wildignore+=*.png,*.jpg,*.gif
- " }}}
- " Color {{{
- " -----------------------------------------------------------------------------
- colorscheme gruvbox
- " For Gruvbox to look correct in terminal Vim you'll want to source a palette
- " script that comes with the Gruvbox plugin.
- "
- " Add this to your ~/.profile file:
- " source "$HOME/.vim/bundle/gruvbox/gruvbox_256palette.sh"
- " Gruvbox comes with both a dark and light theme.
- set background=dark
- " Gruvbox has 'hard', 'medium' (default) and 'soft' contrast options.
- let g:gruvbox_contrast_light='hard'
- " This needs to come last, otherwise the colors aren't correct.
- syntax on
- if (&background == 'dark')
- " Fix the disgusting visual selection colors of gruvbox (thanks @romainl).
- hi Visual cterm=NONE ctermfg=NONE ctermbg=237 guibg=#3a3a3a
- " Set a custom highlight color when yanking text.
- " This requires having the plugin: machakann/vim-highlightedyank
- hi HighlightedyankRegion cterm=NONE ctermbg=239 guibg=#4e4e4e
- else
- hi Visual cterm=NONE ctermfg=NONE ctermbg=223 guibg=#ffd7af
- hi HighlightedyankRegion cterm=NONE ctermbg=228 guibg=ffff87
- endif
- " }}}
- " highlighting and cursor {{{
- "hi CursorLine ctermbg=darkgrey ctermfg=none term=bold cterm=bold
- hi CursorColumn ctermbg=darkred ctermfg=white term=bold cterm=bold
- hi StatusLine ctermbg=darkred ctermfg=white term=bold cterm=bold
- hi Normal ctermbg=black ctermfg=none term=bold cterm=bold
- hi Visual ctermbg=lightred ctermfg=black term=bold cterm=bold
- hi Folded ctermbg=black ctermfg=red term=bold cterm=bold
- hi FoldColumn ctermbg=green ctermfg=yellow term=bold cterm=bold
- hi Search ctermbg=yellow ctermfg=black term=bold cterm=bold
- hi Cursor ctermbg=yellow ctermfg=yellow term=bold cterm=bold
- hi iCursor ctermbg=yellow ctermfg=yellow term=bold cterm=bold
- hi SpellBad cterm=underline ctermfg=9
- hi SpellLocal cterm=underline ctermfg=9
- hi SpellRare cterm=underline ctermfg=9
- hi SpellCap cterm=underline
- ":hi MyGroup cterm=bold
- ":match MyGroup /./
- "make block cursor
- let &t_ti.="\e[1 q"
- let &t_SI.="\e[5 q"
- let &t_EI.="\e[1 q"
- let &t_te.="\e[0 q"
- "
- au InsertEnter * :hi StatusLine ctermbg=darkgreen ctermfg=white term=bold cterm=bold
- au InsertLeave * :hi StatusLine ctermbg=darkred ctermfg=white term=bold cterm=bold
- " }}}
- " differnt settings {{{
- "
- runtime! macros/matchit.vim
- "
- " open file externally
- nnoremap <leader>o :silent !xdg-open <cfile>&<CR>
- "leader n highlight current word and search it
- :nnoremap <leader>n :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
- " set current directory to the directory of the current file
- autocmd BufEnter * if expand("%:p:h") !~ '^/tmp' | silent! lcd %:p:h | endif
- " Quick write session with F2
- map <F2> :mksession! ~/.vim/vim_session <cr>
- " And load session with F3
- map <F3> :source ~/.vim/vim_session <cr>
- " Automatically deletes all trailing whitespace on save.
- autocmd BufWritePre * %s/\s\+$//e
- " remember last position
- if has("autocmd")
- au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
- endif
- " }}}
- " mouvements and buffers {{{
- "f5 to show buffers
- :nnoremap <F5> :buffers<CR>:buffer<Space>
- nmap <F6> :TagbarToggle<CR>
- "window mouvements
- nnoremap <down> <C-W><C-J>
- nnoremap <up> <C-W><C-K>
- nnoremap <right> <C-W><C-L>
- nnoremap <left> <C-W><C-H>
- " moving around
- nmap <silent> <A-Up> :wincmd k<CR>
- nmap <silent> <A-Down> :wincmd j<CR>
- nmap <silent> <A-Left> :wincmd h<CR>
- nmap <silent> <A-Right> :wincmd l<CR>
- " moving blocks of code
- vnoremap < <gv
- vnoremap > >gv
- " cycle through buffers
- nnoremap <Tab> :bnext<CR>
- nnoremap <S-Tab> :bprevious<CR>
- "nnoremap <Tab> <C-W><C-L>
- "nnoremap <S-Tab> <C-W><C-H>
- " this function is a great way to open old files
- function! Output()
- enew | 0put =v:oldfiles| nnoremap <buffer> <CR> :e <C-r>=getline('.')<CR><CR>|normal gg<CR>
- setlocal buftype=nofile bufhidden=wipe noswapfile nowrap
- "setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
- endfunction
- :command! Browse call Output()
- :command! Mm call Output()
- :command! MM call Output()
- " ????
- "command! -nargs=1 -complete=help H :enew | :set buftype=help | :h <args>
- " ????
- "if has("autocmd")
- " au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
- "endif
- " }}}
- " Basic mappings {{{
- " -----------------------------------------------------------------------------
- "" Seamlessly treat visual lines as actual lines when moving around.
- "noremap j gj
- "noremap k gk
- "noremap <Down> gj
- "noremap <Up> gk
- "inoremap <Down> <C-o>gj
- "inoremap <Up> <C-o>gk
- "
- "" Navigate around splits with a single key combo.
- "nnoremap <C-l> <C-w><C-l>
- "nnoremap <C-h> <C-w><C-h>
- "nnoremap <C-k> <C-w><C-k>
- "nnoremap <C-j> <C-w><C-j>
- "
- "" Cycle through splits.
- "nnoremap <S-Tab> <C-w>w
- "
- "" Press * to search for the term under the cursor or a visual selection and
- "" then press a key below to replace all instances of it in the current file.
- "nnoremap <Leader>r :%s///g<Left><Left>
- "nnoremap <Leader>rc :%s///gc<Left><Left><Left>
- "
- "" The same as above but instead of acting on the whole file it will be
- "" restricted to the previously visually selected range. You can do that by
- "" pressing *, visually selecting the range you want it to apply to and then
- "" press a key below to replace all instances of it in the current selection.
- "xnoremap <Leader>r :s///g<Left><Left>
- "xnoremap <Leader>rc :s///gc<Left><Left><Left>
- "
- "" Type a replacement term and press . to repeat the replacement again. Useful
- "" for replacing a few instances of the term (comparable to multiple cursors).
- "nnoremap <silent> s* :let @/='\<'.expand('<cword>').'\>'<CR>cgn
- "xnoremap <silent> s* "sy:let @/=@s<CR>cgn
- "
- "" Clear search highlights.
- "map <Leader><Space> :let @/=''<CR>
- "
- "" Format paragraph (selected or not) to 80 character lines.
- "nnoremap <Leader>g gqap
- "xnoremap <Leader>g gqa
- "
- "" Prevent x from overriding what's in the clipboard.
- "noremap x "_x
- "noremap X "_x
- "
- "" Prevent selecting and pasting from overwriting what you originally copied.
- "xnoremap p pgvy
- "
- "" Keep cursor at the bottom of the visual selection after you yank it.
- "vmap y ygv<Esc>
- "
- "" Edit Vim config file in a new tab.
- "map <Leader>ev :tabnew $MYVIMRC<CR>
- "
- "" Source Vim config file.
- "map <Leader>sv :source $MYVIMRC<CR>
- "
- "" Toggle spell check.
- "map <F5> :setlocal spell!<CR>
- "
- "" Toggle relative line numbers and regular line numbers.
- "nmap <F6> :set invrelativenumber<CR>
- "
- "" Automatically fix the last misspelled word and jump back to where you were.
- "" Taken from this talk: https://www.youtube.com/watch?v=lwD8G1P52Sk
- "nnoremap <leader>sp :normal! mz[s1z=`z<CR>
- "
- "" Toggle quickfix window.
- "function! QuickFix_toggle()
- " for i in range(1, winnr('$'))
- " let bnum = winbufnr(i)
- " if getbufvar(bnum, '&buftype') == 'quickfix'
- " cclose
- " return
- " endif
- " endfor
- "
- " copen
- "endfunction
- "nnoremap <silent> <Leader>c :call QuickFix_toggle()<CR>
- "
- "" Convert the selected text's title case using the external tcc script.
- "" Requires: https://github.com/nickjj/title-case-converter
- "vnoremap <Leader>tc c<C-r>=system('tcc', getreg('"'))[:-2]<CR>
- "
- " }}}
- " Basic autocommands {{{
- " -----------------------------------------------------------------------------
- "
- "" Auto-resize splits when Vim gets resized.
- "autocmd VimResized * wincmd =
- "
- "" Update a buffer's contents on focus if it changed outside of Vim.
- "au FocusGained,BufEnter * :checktime
- "
- "" Unset paste on InsertLeave.
- "autocmd InsertLeave * silent! set nopaste
- "
- "" Make sure all types of requirements.txt files get syntax highlighting.
- "autocmd BufNewFile,BufRead requirements*.txt set syntax=python
- "
- "" Ensure tabs don't get converted to spaces in Makefiles.
- "autocmd FileType make setlocal noexpandtab
- "
- "" Only show the cursor line in the active buffer.
- "augroup CursorLine
- " au!
- " au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
- " au WinLeave * setlocal nocursorline
- "augroup END
- "
- " ----------------------------------------------------------------------------
- "" Basic commands
- "" ----------------------------------------------------------------------------
- "
- "" Add all TODO items to the quickfix list relative to where you opened Vim.
- "function! s:todo() abort
- " let entries = []
- " for cmd in ['git grep -niIw -e TODO -e FIXME 2> /dev/null',
- " \ 'grep -rniIw -e TODO -e FIXME . 2> /dev/null']
- " let lines = split(system(cmd), '\n')
- " if v:shell_error != 0 | continue | endif
- " for line in lines
- " let [fname, lno, text] = matchlist(line, '^\([^:]*\):\([^:]*\):\(.*\)')[1:3]
- " call add(entries, { 'filename': fname, 'lnum': lno, 'text': text })
- " endfor
- " break
- " endfor
- "
- " if !empty(entries)
- " call setqflist(entries)
- " copen
- " endif
- "endfunction
- "
- "command! Todo call s:todo()
- "
- "" Profile Vim by running this command once to start it and again to stop it.
- "function! s:profile(bang)
- " if a:bang
- " profile pause
- " noautocmd qall
- " else
- " profile start /tmp/profile.log
- " profile func *
- " profile file *
- " endif
- "endfunction
- "
- "command! -bang Profile call s:profile(<bang>0)
- " }}}
- " Plugin settings, mappings and autocommands {{{
- " -----------------------------------------------------------------------------
- " .............................................................................
- " junegunn/fzf.vim
- " .............................................................................
- let $FZF_DEFAULT_OPTS = '--bind ctrl-a:select-all'
- let g:fzf_action = {
- \ 'ctrl-t': 'tab split',
- \ 'ctrl-x': 'split',
- \ 'ctrl-v': 'vsplit',
- \ 'ctrl-y': {lines -> setreg('*', join(lines, "\n"))}}
- " Launch fzf with CTRL+P.
- nnoremap <silent> <C-p> :FZF -m<CR>
- " Map a few common things to do with FZF.
- nnoremap <silent> <Leader>, :Buffers<CR>
- nnoremap <silent> <Leader>j :Lines<CR>
- nnoremap <silent> <Leader>h :Commands<CR>
- nnoremap <silent> <Leader><leader> :History<CR>
- " Allow passing optional flags into the Rg command.
- " Example: :Rg myterm -g '*.md'
- command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case " . <q-args>, 1, <bang>0)
- " .............................................................................
- " mhinz/vim-grepper
- " .............................................................................
- let g:grepper={}
- let g:grepper.tools=["rg"]
- xmap gr <plug>(GrepperOperator)
- " After searching for text, press this mapping to do a project wide find and
- " replace. It's similar to <leader>r except this one applies to all matches
- " across all files instead of just the current file.
- nnoremap <Leader>R
- \ :let @s='\<'.expand('<cword>').'\>'<CR>
- \ :Grepper -cword -noprompt<CR>
- \ :cfdo %s/<C-r>s//g \| update
- \<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>
- " The same as above except it works with a visual selection.
- xmap <Leader>R
- \ "sy
- \ gvgr
- \ :cfdo %s/<C-r>s//g \| update
- \<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>
- " .............................................................................
- " ntpeters/vim-better-whitespace
- " .............................................................................
- let g:strip_whitespace_confirm=0
- let g:strip_whitelines_at_eof=1
- let g:strip_whitespace_on_save=1
- " .............................................................................
- " Konfekt/FastFold
- " .............................................................................
- let g:fastfold_savehook=0
- let g:fastfold_fold_command_suffixes=[]
- " .............................................................................
- " junegunn/limelight.vim
- " .............................................................................
- let g:limelight_conceal_ctermfg=244
- " .............................................................................
- " iamcco/markdown-preview.nvim
- " .............................................................................
- let g:mkdp_auto_close=0
- let g:mkdp_refresh_slow=1
- let g:mkdp_markdown_css='/home/mosaid/.local/lib/github-markdown-css/github-markdown.css'
- " .............................................................................
- " iamcco/markdown-preview.nvim
- " .............................................................................
- let g:mkdp_refresh_slow=1
- let g:mkdp_markdown_css='/home/mosaid/.local/lib/github-markdown-css/github-markdown.css'
- " .............................................................................
- " YouCompleteMe
- " .............................................................................
- let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
- let g:ycm_add_preview_to_completeopt = 0
- "let g:ycm_autoclose_preview_window_after_insertion = 1
- "let g:ycm_autoclose_preview_window_after_completion = 1
- let g:ycm_collect_identifiers_from_tags_files = 1
- "set tags+=~/.vim/tags/testtags
- let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
- let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
- let g:ycm_key_list_accept_completion = ['<C-y>']
- " Additional YouCompleteMe config.
- let g:ycm_complete_in_comments = 1
- let g:ycm_collect_identifiers_from_comments_and_strings = 1
- let g:ycm_seed_identifiers_with_syntax = 1
- let g:ycm_server_python_interpreter='python3'
- map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
- " Disable unhelpful semantic completions.
- "let g:ycm_filetype_specific_completion_to_disable = {
- " \ 'c': 1,
- " \ 'gitcommit': 1,
- " \ 'haskell': 1,
- " \ 'javascript': 1,
- " \ 'ruby': 1
- " \ }
- "
- let g:ycm_semantic_triggers = {
- \ 'haskell': [
- \ '.',
- \ '(',
- \ ',',
- \ ', '
- \ ]
- \ }
- " Same as default, but with "markdown" and "text" removed.
- let g:ycm_filetype_blacklist = {
- \ 'notes': 1,
- \ 'unite': 1,
- \ 'tagbar': 1,
- \ 'pandoc': 1,
- \ 'qf': 1,
- \ 'vimwiki': 1,
- \ 'infolog': 1,
- \ 'mail': 1
- \ }
- " }}}
- " latex-suite {{{
- " let g:tex_flavor='latex'
- " " }}}
- " Ranger {{{
- "
- let g:ranger_map_keys = 1
- "
- " " add this line if you use NERDTree
- let g:NERDTreeHijackNetrw = 0
- "
- " " open ranger when vim open a directory
- " let g:ranger_replace_netrw = 1
- "
- "
- " " }}}
- " nerdtree {{{
- "
- let NERDTreeIgnore = ['__pycache__', '\.pyc$', '\.o$', '\.so$',
- \ '\.a$', '\.swp', '*\.swp', '\.swo', '\.swn', '\.swh',
- \ '\.swm', '\.swl', '\.swk', '\.sw*$', '[a-zA-Z]*egg[a-zA-Z]*',
- \ '.DS_Store']
- let g:NERDTreeMinimalUI = 1
- let g:NERDTreeDirArrows=1
- let g:NERDTreeShowHidden=1
- let g:NERDTreeAutoDeleteBuffer=1
- let g:NERDTreeWinPos="left"
- let g:NERDTreeMenuUp='<UP>'
- let g:NERDTreeMenuDown='<DOWN>'
- map <C-t> :NERDTreeToggle %<CR>
- " Open nerd tree at the current file or close nerd tree if pressed again.
- nnoremap <silent> <expr> <Leader>n g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "\:NERDTree<CR>"
- "
- " " }}}
- " dragvisuals {{{
- "
- " runtime plugin/dragvisuals.vim
- "
- " vmap <expr> <LEFT> DVB_Drag('left')
- " vmap <expr> <RIGHT> DVB_Drag('right')
- " vmap <expr> <DOWN> DVB_Drag('down')
- " vmap <expr> <UP> DVB_Drag('up')
- " vmap <expr> D DVB_Duplicate()
- "
- " " Remove any introduced trailing whitespace after moving...
- " let g:DVB_TrimWS = 1
- "
- " vmap <expr> ++ VMATH_YankAndAnalyse()
- " nmap ++ vip++
- "
- " " }}}
- " HardMode {{{
- "
- " "autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
- " nnoremap <leader>h <Esc>:call EasyMode()<CR>
- " nnoremap <leader>H <Esc>:call HardMode()<CR>
- "
- " " }}}
- " CommandT {{{
- "
- " let g:CommandTMaxFiles=2000000
- "
- " " }}}
- " ultisnips {{{
- "
- " " YouCompleteMe and UltiSnips compatibility.
- " let g:UltiSnipsExpandTrigger = '<Tab>'
- " let g:UltiSnipsJumpForwardTrigger = '<Tab>'
- " let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'
- "
- " " Prevent UltiSnips from removing our carefully-crafted mappings.
- " let g:UltiSnipsMappingsToIgnore = ['autocomplete']
- "
- " "" Additional UltiSnips config.
- " "let g:UltiSnipsSnippetsDir = '~/.vim/ultisnips'
- " "let g:UltiSnipsSnippetDirectories = ['ultisnips']
- " " }}}
- " vim-latex-preview {{{
- " let g:livepreview_previewer = 'okular'
- " let g:livepreview_engine = 'xelatex'
- " let g:livepreview_cursorhold_recompile = 0
- " " }}}
- " vim prettier {{{
- " " max line length that prettier will wrap on
- " " Prettier default: 80
- " let g:prettier#config#print_width = 120
- "
- " " number of spaces per indentation level
- " " Prettier default: 2
- " let g:prettier#config#tab_width = 4
- "
- " " use tabs over spaces
- " " Prettier default: false
- " let g:prettier#config#use_tabs = 'true'
- "
- " " print semicolons
- " " Prettier default: true
- " let g:prettier#config#semi = 'true'
- "
- " " single quotes over double quotes
- " " Prettier default: false
- " let g:prettier#config#single_quote = 'true'
- "
- " " print spaces between brackets
- " " Prettier default: true
- " let g:prettier#config#bracket_spacing = 'false'
- "
- " " put > on the last line instead of new line
- " " Prettier default: false
- " let g:prettier#config#jsx_bracket_same_line = 'true'
- "
- " " avoid|always
- " " Prettier default: avoid
- " let g:prettier#config#arrow_parens = 'always'
- "
- " " none|es5|all
- " " Prettier default: none
- " let g:prettier#config#trailing_comma = 'all'
- "
- " " flow|babylon|typescript|css|less|scss|json|graphql|markdown
- " " Prettier default: babylon
- " let g:prettier#config#parser = 'flow'
- "
- " " cli-override|file-override|prefer-file
- " let g:prettier#config#config_precedence = 'prefer-file'
- "
- " " always|never|preserve
- " let g:prettier#config#prose_wrap = 'preserve'
- "
- " " css|strict|ignore
- " let g:prettier#config#html_whitespace_sensitivity = 'css'
- "
- " " when running at every change you may want to disable quickfix
- " let g:prettier#quickfix_enabled = 0
- "
- " let g:prettier#autoformat = 0
- " autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
- "
- " " }}}
- " my snippets {{{
- " "inoremap <leader><leader> <esc>/<++><Enter>"_c4l
- " "vnoremap <leader><leader> <esc>/<++><Enter>"_c4l
- "
- "
- "
- " let g:jedi#goto_command = "<leader>d"
- " let g:jedi#goto_assignments_command = "<leader>g"
- " let g:jedi#goto_definitions_command = "enew"
- " let g:jedi#documentation_command = "K"
- " let g:jedi#usages_command = "<leader>n"
- " let g:jedi#completions_command = "<C-Space>"
- " let g:jedi#rename_command = "<leader>r"
- "
- "
- " " }}}
- "
- "runtime! macros/matchit.vim
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement