Created
May 17, 2019 17:20
-
-
Save kevinslin/99d2e7a8cebd695245f0e0cd46133090 to your computer and use it in GitHub Desktop.
vim plugin and options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " --- Plugins {{{1 | |
| call plug#begin('~/.local/share/nvim/plugged') | |
| " --- Essential {{{2 | |
| Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
| Plug 'plasticboy/vim-markdown' | |
| Plug 'SirVer/ultisnips' | |
| Plug 'xolox/vim-session' | |
| " --- UI {{{2 | |
| Plug 'altercation/vim-colors-solarized' | |
| Plug 'iCyMind/NeoSolarized' | |
| " --- Code {{{2 | |
| " Syntax | |
| Plug 'leafgarland/typescript-vim' | |
| Plug 'mxw/vim-jsx' | |
| Plug 'pangloss/vim-javascript' | |
| Plug 'wavded/vim-stylus' | |
| Plug 'dylon/vim-antlr' | |
| Plug 'kchmck/vim-coffee-script' | |
| Plug 'majutsushi/tagbar' | |
| Plug 'Galooshi/vim-import-js' " auto import js dependencies | |
| Plug 'tpope/vim-fugitive' " vim git plugin | |
| Plug 'scrooloose/nerdcommenter' | |
| Plug 'Valloric/YouCompleteMe', { 'do': './install.py' } | |
| Plug 'tpope/vim-surround' | |
| Plug 'davidhalter/jedi-vim' | |
| " --- Utils {{{2 | |
| Plug 'terryma/vim-multiple-cursors' | |
| Plug 'kburdett/vim-nuuid' | |
| Plug 'godlygeek/tabular' | |
| Plug 'dhruvasagar/vim-table-mode' | |
| Plug 'tpope/vim-eunuch' " Rename, Delete and other useful commands | |
| Plug 'jeetsukumaran/vim-indentwise' | |
| Plug 'jeffkreeftmeijer/vim-numbertoggle' | |
| Plug 'mkitt/tabline.vim' | |
| " --- New {{{2 | |
| " install fzf cli | |
| Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
| " install fzf vim plugin | |
| Plug 'junegunn/fzf.vim' | |
| Plug 'Konfekt/FastFold' | |
| " --- Rest {{{2 | |
| Plug 'christoomey/vim-tmux-navigator' | |
| Plug 'xolox/vim-misc' " required by vim-session | |
| Plug 'ervandew/supertab' | |
| Plug 'Shougo/denite.nvim' | |
| Plug 'jamessan/vim-gnupg' | |
| " begin needed for denite in vim | |
| Plug 'roxma/vim-hug-neovim-rpc' | |
| Plug 'roxma/nvim-yarp' | |
| " end | |
| call plug#end() | |
| " --- Plugin Options {{{1 | |
| " Denite {{{3 | |
| call denite#custom#var('file_rec', 'command', | |
| \ ['rg', '--files', '--glob', '!.git']) | |
| call denite#custom#var('grep', 'command', ['rg']) | |
| call denite#custom#var('grep', 'default_opts', | |
| \ ['--hidden', '--vimgrep', '--smart-case']) | |
| call denite#custom#var('grep', 'recursive_opts', []) | |
| call denite#custom#var('grep', 'pattern_opt', ['--regexp']) | |
| call denite#custom#var('grep', 'separator', ['--']) | |
| call denite#custom#var('grep', 'final_opts', []) | |
| call denite#custom#map('insert', '<Esc>', '<denite:enter_mode:normal>', | |
| \'noremap') | |
| call denite#custom#map('normal', '<Esc>', '<NOP>', | |
| \'noremap') | |
| call denite#custom#map('insert', '<C-v>', '<denite:do_action:vsplit>', | |
| \'noremap') | |
| call denite#custom#map('normal', '<C-v>', '<denite:do_action:vsplit>', | |
| \'noremap') | |
| call denite#custom#map('insert', '<C-t>', '<denite:do_action:tabopen>', | |
| \'noremap') | |
| call denite#custom#map('normal', '<C-t>', '<denite:do_action:tabopen>', | |
| \'noremap') | |
| call denite#custom#map( | |
| \ 'insert', | |
| \ '<Down>', | |
| \ '<denite:move_to_next_line>', | |
| \ 'noremap' | |
| \) | |
| call denite#custom#map( | |
| \ 'insert', | |
| \ '<Up>', | |
| \ '<denite:move_to_previous_line>', | |
| \ 'noremap' | |
| \) | |
| function! NoahBrowse() | |
| execute "Denite -input=" . expand('%:r') . " file/rec" | |
| endfunction | |
| command! NoahBrowse call NoahBrowse() | |
| nnoremap <C-p> :<C-u>Denite file_rec<CR> | |
| nnoremap <leader>s :<C-u>Denite buffer<CR> | |
| nnoremap <leader>1 :NoahBrowse<CR> | |
| " Fastfold {{{3 | |
| let g:markdown_folding = 1 | |
| let g:fastfold_savehook = 0 " don't toggle fold on save | |
| " NERDTree {{{3 | |
| nnoremap <Leader>n :NERDTreeToggle<CR> | |
| " close vim if nerdtree is only open window | |
| autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif | |
| " supertab {{{3 | |
| " make ycm and ultisnip work together | |
| " src: https://stackoverflow.com/questions/14896327/ultisnips-and-youcompleteme | |
| let g:SuperTabDefaultCompletionType = '<C-n>' | |
| " tagbar {{{3 | |
| nnoremap <Leader>rt :Tagbar<CR> | |
| " UltiSnips {{{3 | |
| " ultisnips by default installs in .vim | |
| set runtimepath+=~/.vim | |
| let g:UltiSnipsExpandTrigger = "<tab>" | |
| let g:UltiSnipsJumpForwardTrigger = "<tab>" | |
| let g:UltiSnipsJumpBackwardTrigger = "<s-tab>" | |
| nnoremap <Leader>eu :UltiSnipsEdit<CR> | |
| nnoremap <Leader>ru :call UltiSnips#RefreshSnippets()<CR> | |
| " vim-markdown {{{3 | |
| function! AutoToc() | |
| exec join(["autocmd BufWrite", expand('%:p'), ":Toc"], " ") | |
| endfunction | |
| let g:vim_markdown_new_list_item_indent = 0 " otherwise sets indent to 4 by default | |
| let g:vim_markdown_auto_insert_bullets = 0 " don't want auto bullets | |
| let g:vim_markdown_toc_autofit = 1 | |
| let g:vim_markdown_emphasis_multiline = 0 | |
| let g:vim_markdown_frontmatter = 1 | |
| let g:vim_markdown_strikethrough = 1 " enables ~~ syntax | |
| ca HD HeaderDecrease | |
| ca HI HeaderIncrease | |
| let g:vim_markdown_toc_autofit = 1 | |
| nnoremap <Leader>t :Toc<CR> | |
| nnoremap <Leader>tr :call AutoToc()<CR> | |
| " vim-markdown-folding {{{3 | |
| let g:markdown_fold_style = 'nested' | |
| " vim-session {{{3 | |
| let g:session_autosave = 'yes' | |
| let g:session_autosave_periodic = 30 | |
| let g:session_autoload = 'no' | |
| ca oto OpenTabSession! | |
| ca oo! OpenSession! | |
| ca ss! SaveSession! | |
| ca sts! SaveTabSession! | |
| set sessionoptions-=buffers,blank | |
| " YouCompleteMe {{{3 | |
| let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] | |
| let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment