-
-
Save yihuaxiang/cff79ec709a05150eb360f515bf76f49 to your computer and use it in GitHub Desktop.
Revisions
-
subfuzion revised this gist
Jan 3, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ I recently switched over to [neovim](https://neovim.io/) (see my screenshots at the bottom). Below is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc). It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). -
subfuzion revised this gist
Jan 3, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ I recently switched over to [neovim](https://neovim.io/). Below is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc). It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). -
subfuzion revised this gist
Jan 3, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,10 @@ In the section below, you can substitute `;` for whatever you have configured fo | Shortcut | Action | | -------- | ------ | | `;c` | Toggle light and dark themes | `;h` | Toggle distraction free mode (hide/show both nerdtree and tagbar) | `Space` | Toggle [NERD Tree](https://github.com/scrooloose/nerdtree), a file tree explorer. | `;tb` | Toggle tagbar | `C-l` | Redraw and ald also clear current highlighted search items (note: `l' is lowercase `L`, not number `1`) | `C-p` | Open fuzzy finder (for files, buffers, etc) -
subfuzion revised this gist
Jan 3, 2017 . 1 changed file with 135 additions and 29 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,31 @@ " Plug (vim-plug) - plugin manager " https://github.com/junegunn/vim-plug " Basically: after adding a plug, just remember to run 'PlugInstall' " This is best with neovim! " https://neovim.io/ " http://nerditya.com/code/guide-to-neovim/ " Other helpful links: " http://learnvimscriptthehardway.stevelosh.com/ " http://andrewradev.com/2011/08/06/making-vim-pretty-with-custom-colors/ " ===================================== call plug#begin('~/.vim/plugged') " ------------------------------------- " various color schemes (neovim default is 'dark'; I like 'slate' with dark background) " http://vimcolors.com/ Plug 'freeo/vim-kalisi' Plug 'w0ng/vim-hybrid' Plug 'bitterjug/vim-colors-bitterjug' Plug 'jonathanfilip/vim-lucius' Plug 'crusoexia/vim-monokai' Plug 'jacoborus/tender.vim' Plug 'pbrisbin/vim-colors-off' Plug 'muellan/am-colors' Plug 'blueshirts/darcula' " NERD Tree - tree explorer " https://github.com/scrooloose/nerdtree " http://usevim.com/2012/07/18/nerdtree/ " (loaded on first invocation of the command) Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } @@ -36,10 +55,30 @@ Plug 'editorconfig/editorconfig-vim' " Make vim a first class Go development environment " https://github.com/fatih/vim-go Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } " vim-misc " https://github.com/xolox/vim-misc Plug 'xolox/vim-misc' " vim-easytags " https://github.com/xolox/vim-easytags Plug 'xolox/vim-easytags' " Tagbar " https://github.com/majutsushi/tagbar Plug 'majutsushi/tagbar' " https://github.com/nsf/gocode Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' } " deoplete (for gocode completion support) " https://github.com/Shougo/deoplete.nvim Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " deoplete-go (for gocode completion support) " https://github.com/zchee/deoplete-go Plug 'zchee/deoplete-go', { 'do': 'make'} " Markdown support " https://github.com/plasticboy/vim-markdown @@ -55,13 +94,6 @@ Plug 'benmills/vimux' " https://github.com/ctrlpvim/ctrlp.vim Plug 'ctrlpvim/ctrlp.vim' " A better grep (source code aware) " You must install ack on your machine for the plugin to work " sudo apt-get install ack-grep, brew install ack, etc. @@ -75,6 +107,10 @@ Plug 'mileszs/ack.vim' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' " indentline " https://github.com/Yggdroot/indentLine Plug 'Yggdroot/indentLine' " ------------------------------------- " Add plugins to &runtimepath call plug#end() @@ -112,7 +148,7 @@ set ai sw=8 set list lcs=tab:\ \ " highlight matches when searching " Use C-l to clear (see key map section) set hlsearch " Line numbering @@ -158,7 +194,12 @@ let g:vim_markdown_folding_disabled = 1 set splitright set splitbelow " Use Ag (the silver searcher) instack of Ack let g:ackprg = 'ag --nogroup --nocolor --column' " ===================================== " Theme color scheme settings " ===================================== " blue " darkblue " default @@ -176,23 +217,35 @@ set splitbelow " slate " torte " zellner " ------------------------------------- function! Light() echom "set bg=light" set bg=light colorscheme off set list endfunction function! Dark() echom "set bg=dark" set bg=dark colorscheme darcula "darcula fix to hide the indents: set nolist endfunction function! ToggleLightDark() if &bg ==# "light" call Dark() else call Light() endif endfunction " adjustments "hi Statement ctermfg=1 guifg=#60BB60 "hi Constant ctermfg=4 " for macvim " " Disable scrollbar in gui @@ -202,9 +255,6 @@ set guioptions-=r " set guifont=Menlo\ Regular:h16 " ===================================== " key map " Understand mapping modes: @@ -233,6 +283,9 @@ inoremap ;; <Esc> "nmap <C-@> <C-Space> nnoremap <silent> <Space> :NERDTreeToggle<CR> " toggle tagbar nnoremap <silent> <leader>tb :TagbarToggle<CR> " toggle line numbers nnoremap <silent> <leader>n :set number! number?<CR> @@ -323,11 +376,18 @@ let g:go_highlight_types = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 " go-def is automatically by default to plain "gd" (no leader required) au FileType go nnoremap <Leader>gd <Plug>(go-def) au FileType go nmap <Leader>gp <Plug>(go-def-pop) au FileType go nnoremap <Leader>gv <Plug>(go-doc-vertical) " or open in a browser... au FileType go nnoremap <Leader>gb <Plug>(go-doc-browser) au FileType go nnoremap <Leader>s <Plug>(go-implements) au FileType go nnoremap <Leader>i <Plug>(go-info) au FileType go nnoremap <Leader>gl <Plug>(go-metalinter) au FileType go nnoremap <Leader>gc <Plug>(go-callers) " ===================================== " vim-airline status @@ -345,12 +405,23 @@ function! ToggleHiddenAll() set noruler set laststatus=0 set noshowcmd TagbarClose NERDTreeClose set foldcolumn=10 else set foldcolumn=0 let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd NERDTree " NERDTree takes focus, so move focus back to the right " (note: "l" is lowercase L (mapped to moving right) wincmd l TagbarOpen endif endfunction @@ -370,3 +441,38 @@ nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR> " --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) " --color: Search color options command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0) " ===================================== " Custom styling " ===================================== " http://stackoverflow.com/questions/9001337/vim-split-bar-styling set fillchars+=vert:\ " http://vim.wikia.com/wiki/Highlight_current_line " http://stackoverflow.com/questions/8750792/vim-highlight-the-whole-current-line " http://vimdoc.sourceforge.net/htmldoc/autocmd.html#autocmd-events autocmd BufEnter * setlocal cursorline autocmd WinEnter * setlocal cursorline autocmd BufLeave * setlocal nocursorline autocmd WinLeave * setlocal nocursorline " tagbar autopen "autocmd VimEnter * nested :call tagbar#autoopen(1) "autocmd FileType * nested :call tagbar#autoopen(0) "autocmd BufEnter * nested :call tagbar#autoopen(0) " ===================================== " auto completion " ===================================== set completeopt+=noinsert set completeopt+=noselect let g:deoplete#enable_at_startup = 1 let g:deoplete#sources#go#use_cache = 1 " ===================================== " Init " ===================================== silent call Dark() autocmd VimEnter * wincmd p -
subfuzion revised this gist
Dec 16, 2016 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -62,14 +62,20 @@ In the section below, you can substitute `;` for whatever you have configured fo | `;th` | Open a terminal in a new split below | | `;c` | Toggle between light and dark backround modes (for supported themes) #### Go support | Shortcut | Action | | -------- | ------ | | `gd` | go-def | `;gd` | go-doc | `;gv` | go-doc in a new vertical split to the right | `;gb` | go-doc for current word in a new browser window/tab | `;gs` | go-implements | `gi` | go-info To learn more or customize yourself, see [fatih/vim-go](https://github.com/fatih/vim-go) and read [this](http://hackersome.com/p/fatih/vim-go). ### Terminal mode | Shortcut | Action | -
subfuzion revised this gist
Dec 6, 2016 . 1 changed file with 32 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Plug 'vim-airline/vim-airline-themes' " Save/restore session support " https://github.com/tpope/vim-obsession " tmux users also see: https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_vim_and_neovim_sessions.md Plug 'tpope/vim-obsession' " Excellent git wrapper @@ -61,6 +62,19 @@ Plug 'w0ng/vim-hybrid' Plug 'bitterjug/vim-colors-bitterjug' Plug 'jonathanfilip/vim-lucius' " A better grep (source code aware) " You must install ack on your machine for the plugin to work " sudo apt-get install ack-grep, brew install ack, etc. Plug 'mileszs/ack.vim' " OMG - insanely awesome fuzzy search and blazing fast grep " https://github.com/junegunn/fzf (parent project) " https://github.com/junegunn/fzf.vim (more extensive wrapper) " https://medium.com/@crashybang/supercharge-vim-with-fzf-and-ripgrep-d4661fc853d2#.rkhrm332m " To update: :PlugUpdate fzf Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' " ------------------------------------- " Add plugins to &runtimepath call plug#end() @@ -188,6 +202,9 @@ set guioptions-=r " set guifont=Menlo\ Regular:h16 " Use Ag (the silver searcher) instack of Ack let g:ackprg = 'ag --nogroup --nocolor --column' " ===================================== " key map " Understand mapping modes: @@ -338,3 +355,18 @@ function! ToggleHiddenAll() endfunction nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR> " ===================================== " Custom find " ===================================== " --column: Show column number " --line-number: Show line number " --no-heading: Do not show file headings in results " --fixed-strings: Search term as a literal string " --ignore-case: Case insensitive search " --no-ignore: Do not respect .gitignore, etc... " --hidden: Search hidden files and folders " --follow: Follow symlinks " --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) " --color: Search color options command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0) -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 49 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -32,9 +32,57 @@ In the section below, you can substitute `;` for whatever you have configured fo ### Normal mode | Shortcut | Action | | -------- | ------ | | `Space` | Toggle [NERD Tree](https://github.com/scrooloose/nerdtree), a file tree explorer. | `C-l` | Redraw and ald also clear current highlighted search items (note: `l' is lowercase `L`, not number `1`) | `C-p` | Open fuzzy finder (for files, buffers, etc) | Shortcut | Action | | -------- | ------ | | `;ec` | Edit vim/neovim config | `;sc` | Source (reload) the config (save it first with `:w`) | | `;n` | Toggle line numbers | `;w` | Toggle wrap | | `bv` | Create a new (empty) buffer to the right of a vertical split | `bh` | Create a new (empty) buffer below a horizontal split | `;bb` | Toggle between current and last buffer | `;bn` | Go to next buffer | `;bp` | Go tp prev buffer | `;bd` | Delete current buffer | `;bk` | Kill current buffer (don't prompt to save changes) | `;bl` | List buffers | `;bg` | List and select buffer by # | | `;tt` | Open a full screen terminal | `;tv` | Open a terminal in a new split to the right | `;th` | Open a terminal in a new split below | | `;c` | Toggle between light and dark backround modes (for supported themes) | | `gd` | go-def | `;gd` | go-doc | `;gv` | go-doc in a new vertical split to the right | `;gb` | go-doc for current word in a new browser window/tab | `;gs` | go-implements | `gi` | go-info ### Terminal mode | Shortcut | Action | | -------- | ------ | | `C-x` | Quit terminal buffer ### Any mode | Shortcut | Action | | -------- | ------ | | `A-h` | Go to buffer to the left | `A-j` | Go to buffer below | `A-k` | Go to buffer above | `A-l` | go to buffer to the right -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,13 +22,19 @@ The leader key is normally defined by the `mapleader` variable as `\`. Many peop `;` In the section below, you can substitute `;` for whatever you have configured for you `<leader>` key. ### Insert mode | Shortcut | Action | | -------- | ------ | | `;;` | Escape (exit insert mode) ### Normal mode | Shortcut | Action | | -------- | ------ | | `;ec` | Edit vim/neovim config | `;sc` | Source (reload) the config (save it first with `:w`) | | `;n` | Toggle line numbers -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,5 +29,6 @@ The leader key is normally defined by the `mapleader` variable as `\`. Many peop ### Normal mode | Shortcut | Action | | -------- | ------ | | `;ec` | Edit vim/neovim config | `;sc` | Source (reload) the config (save it first with `:w`) -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,3 +9,25 @@ tmux, it is quite good and I like having it since it simplifies my documentation These days I primarily develop in Go. I'm super thrilled and grateful for [fatih/vim-go](https://github.com/fatih/vim-go), as well as all the other awesome plugins contributed by an excellent community. ## Key map features I try to avoid C-<key> combinations for the things I do frequently, mapping things that make sense to the `<leader>` key. The [leader key](http://usevim.com/2012/07/20/vim101-leader/) provides a facility for creating customized shortcuts that can be further restricted to apply only in certain modes, such as normal, insert, visual, terminal (neovim-specific), etc. The leader key is normally defined by the `mapleader` variable as `\`. Many people like to redefine it to `,`. I prefer `;` since it sits right under my right pinkie. ### Leader key `;` ### Insert mode `;;` - exit insert mode ### Normal mode | Shortcut | Action | + -------- | ------ | | `;ec` | Edit vim/neovim config | -
subfuzion revised this gist
Oct 23, 2016 . 2 changed files with 36 additions and 29 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,9 @@ Below is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#wher It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer. These days I primarily develop in Go. I'm super thrilled and grateful for [fatih/vim-go](https://github.com/fatih/vim-go), as well as all the other awesome plugins contributed by an excellent community. 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 charactersOriginal file line number Diff line number Diff line change @@ -21,23 +21,26 @@ Plug 'vim-airline/vim-airline' " https://github.com/vim-airline/vim-airline-themes Plug 'vim-airline/vim-airline-themes' " Save/restore session support " https://github.com/tpope/vim-obsession Plug 'tpope/vim-obsession' " Excellent git wrapper " https://github.com/tpope/vim-fugitive Plug 'tpope/vim-fugitive' " Enforce editor settings " https://github.com/editorconfig/editorconfig-vim Plug 'editorconfig/editorconfig-vim' " Make vim a first class Go development environment " https://github.com/fatih/vim-go Plug 'fatih/vim-go' " https://github.com/nsf/gocode Plug 'nsf/gocode' " Markdown support " https://github.com/plasticboy/vim-markdown Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' @@ -46,11 +49,12 @@ Plug 'plasticboy/vim-markdown' " https://github.com/benmills/vimux Plug 'benmills/vimux' " Fuzzy file, buffer, mru, tag, etc finder " ctrlp.vim " https://github.com/ctrlpvim/ctrlp.vim Plug 'ctrlpvim/ctrlp.vim' " various color schemes (neovim default is 'dark'; I like 'slate' with dark background) " http://vimcolors.com/ Plug 'freeo/vim-kalisi' Plug 'w0ng/vim-hybrid' @@ -195,10 +199,10 @@ set guifont=Menlo\ Regular:h16 let mapleader=";" " Shortcut to edit THIS configuration file: (e)dit (c)onfiguration nnoremap <silent> <leader>ec :e $MYVIMRC<CR> " Shortcut to source (reload) THIS configuration file after editing it: (s)ource (c)onfiguraiton nnoremap <silent> <leader>sc :source $MYVIMRC<CR> " use ;; for escape " http://vim.wikia.com/wiki/Avoid_the_escape_key @@ -210,53 +214,53 @@ inoremap ;; <Esc> " http://stackoverflow.com/questions/7722177/how-do-i-map-ctrl-x-ctrl-o-to-ctrl-space-in-terminal-vim#answer-24550772 "nnoremap <C-Space> :NERDTreeToggle<CR> "nmap <C-@> <C-Space> nnoremap <silent> <Space> :NERDTreeToggle<CR> " toggle line numbers nnoremap <silent> <leader>n :set number! number?<CR> " toggle line wrap nnoremap <silent> <leader>w :set wrap! wrap?<CR> " toggle buffer (switch between current and last buffer) nnoremap <silent> <leader>bb <C-^> " go to next buffer nnoremap <silent> <leader>bn :bn<CR> nnoremap <C-l> :bn<CR> " go to previous buffer nnoremap <silent> <leader>bp :bp<CR> " https://github.com/neovim/neovim/issues/2048 nnoremap <C-h> :bp<CR> " close buffer nnoremap <silent> <leader>bd :bd<CR> " kill buffer nnoremap <silent> <leader>bk :bd!<CR> " list buffers nnoremap <silent> <leader>bl :ls<CR> " list and select buffer nnoremap <silent> <leader>bg :ls<CR>:buffer<Space> " horizontal split with new buffer nnoremap <silent> <leader>bh :new<CR> " vertical split with new buffer nnoremap <silent> <leader>bv :vnew<CR> " redraw screan and clear search highlighted items "http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting#answer-25569434 nnoremap <silent> <C-L> :nohlsearch<CR><C-L> " vimux " https://raw.githubusercontent.com/benmills/vimux/master/doc/vimux.txt nnoremap <leader>vc :VimuxPromptCommand<CR> nnoremap <leader>vl :VimuxRunLastCommand<CR> nnoremap <leader>vq :VimuxCloseRunner<CR> nnoremap <leader>vx: VimuxInterruptRunner<CR> " improved keyboard navigation nnoremap <leader>h <C-w>h @@ -278,9 +282,9 @@ nnoremap <A-l> <C-w>l " Start terminal in insert mode au BufEnter * if &buftype == 'terminal' | :startinsert | endif nnoremap <silent> <leader>tt :terminal<CR> nnoremap <silent> <leader>tv :vnew<CR>:terminal<CR> nnoremap <silent> <leader>th :new<CR>:terminal<CR> tnoremap <C-x> <C-\><C-n><C-w>q " ctrlp.vim @@ -289,7 +293,7 @@ let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_working_path_mode = '' " toggle colors to optimize based on light or dark background nnoremap <leader>c :call ToggleLightDark()<CR> " ===================================== " Go -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ I just switched over to [neovim](https://neovim.io/). Below is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc). It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). -
subfuzion renamed this gist
Oct 23, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
subfuzion renamed this gist
Oct 23, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
subfuzion revised this gist
Oct 23, 2016 . 2 changed files with 8 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,3 @@ " Plug (vim-plug) - plugin manager " https://github.com/junegunn/vim-plug " Basically: after adding a plug, just remember to run 'PlugInstall' @@ -344,5 +334,3 @@ function! ToggleHiddenAll() endfunction nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ I just switched over to [neovim](https://neovim.io/). This is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc). It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well it's working for me in neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer. -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,6 @@ This is still a work in progress (everyone's own config is always a labor of lov well it's working for me in neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer. ``` " Plug (vim-plug) - plugin manager " https://github.com/junegunn/vim-plug -
subfuzion revised this gist
Oct 23, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ This is still a work in progress (everyone's own config is always a labor of lov well it's working for me in neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer. The following is also attached as a file to this gist. ``` " Plug (vim-plug) - plugin manager " https://github.com/junegunn/vim-plug -
subfuzion created this gist
Oct 23, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,348 @@ I just switched over to [neovim](https://neovim.io/). This is my updated [config file](https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc). It's currently synchronized with my `.vimrc` config except for a block of [neovim-specific terminal key mappings](https://neovim.io/doc/user/nvim_terminal_emulator.html). This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well it's working for me in neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer. ``` " Plug (vim-plug) - plugin manager " https://github.com/junegunn/vim-plug " Basically: after adding a plug, just remember to run 'PlugInstall' " ===================================== call plug#begin('~/.vim/plugged') " ------------------------------------- " NERD Tree - tree explorer " https://github.com/scrooloose/nerdtree " (loaded on first invocation of the command) Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " nerdtree-git-plugin - show git status in NERD Tree " https://github.com/Xuyuanp/nerdtree-git-plugin Plug 'Xuyuanp/nerdtree-git-plugin' " vim-airline " Enhanced statusline " https://github.com/vim-airline/vim-airline Plug 'vim-airline/vim-airline' " https://github.com/vim-airline/vim-airline-themes Plug 'vim-airline/vim-airline-themes' " Save session " https://github.com/tpope/vim-obsession Plug 'tpope/vim-obsession' " git wrapper " https://github.com/tpope/vim-fugitive Plug 'tpope/vim-fugitive' " https://github.com/editorconfig/editorconfig-vim Plug 'editorconfig/editorconfig-vim' " https://github.com/fatih/vim-go Plug 'fatih/vim-go' " https://github.com/nsf/gocode Plug 'nsf/gocode' " https://github.com/plasticboy/vim-markdown Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' " Nice interaction with tmux " https://github.com/benmills/vimux Plug 'benmills/vimux' " ctrlp.vim " https://github.com/ctrlpvim/ctrlp.vim Plug 'ctrlpvim/ctrlp.vim' " color schemes " http://vimcolors.com/ Plug 'freeo/vim-kalisi' Plug 'w0ng/vim-hybrid' Plug 'bitterjug/vim-colors-bitterjug' Plug 'jonathanfilip/vim-lucius' " ------------------------------------- " Add plugins to &runtimepath call plug#end() " ===================================== " Auto start NERD tree when opening a directory autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | wincmd p | endif " Auto start NERD tree if no files are specified autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | exe 'NERDTree' | endif " Let quit work as expected if after entering :q the only window left open is NERD Tree itself autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " ===================================== " Initial settings " ===================================== " Relax file compatibility restriction with original vi " (not necessary to set with neovim, but useful for vim) set nocompatible " Disable beep / flash set vb t_vb= " Set tabs and indents (for go) set ts=8 set shiftwidth=8 set ai sw=8 " replace tab with spaces "set expandtab " allow cursor to move to beginning of tab " will interfere with soft line wrapping (set nolist) set list lcs=tab:\ \ " highlight matches when searching " Ust C-l to clear (see key map section) set hlsearch " Line numbering " Toggle set to ';n' in key map section set nonumber " Disable line wrapping " Toggle set to ';w' in key map section set nowrap " enable line and column display set ruler "disable showmode since using vim-airline; otherwise use 'set showmode' set noshowmode " file type recognition filetype on filetype plugin on filetype indent on " syntax highlighting syntax on " scroll a bit horizontally when at the end of the line set sidescroll=6 " Make it easier to work with buffers " http://vim.wikia.com/wiki/Easier_buffer_switching set hidden set confirm set autowriteall set wildmenu wildmode=full " markdown " https://github.com/plasticboy/vim-markdown let g:vim_markdown_folding_disabled = 1 " auto switch current working directory to current buffer (not recommended) "autocmd BufEnter * :cd %:p:h " open new split panes to right and below (as you probably expect) set splitright set splitbelow " color scheme " blue " darkblue " default " delek " desert " elflord " evening " koehler " morning " murphy " pablo " peachpuff " ron " shine " slate " torte " zellner colorscheme slate set bg=light " adjustments hi Statement ctermfg=1 guifg=#60BB60 hi Constant ctermfg=4 function! ToggleLightDark() if &bg ==# "light" echom "set bg=dark" set bg=dark else echom "set bg=light" set bg=light endif endfunction " for macvim " " Disable scrollbar in gui " set scrolloff=9999 " hide right scrollbar set guioptions-=r " set guifont=Menlo\ Regular:h16 " ===================================== " key map " Understand mapping modes: " http://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping#answer-3776182 " http://stackoverflow.com/questions/22849386/difference-between-nnoremap-and-inoremap#answer-22849425 " ===================================== " change the leader key from "\" to ";" ("," is also popular) let mapleader=";" " Shortcut to edit THIS configuration file: (e)dit (c)onfiguration nnoremap <silent> <leader>ec :e $MYVIMRC<cr> " Shortcut to source (reload) THIS configuration file after editing it: (s)ource (c)onfiguraiton nnoremap <silent> <leader>sc :source $MYVIMRC<cr> " use ;; for escape " http://vim.wikia.com/wiki/Avoid_the_escape_key inoremap ;; <Esc> " Toggle NERDTree " Can't get <C-Space> by itself to work, so this works as Ctrl - space - space " https://github.com/neovim/neovim/issues/3101 " http://stackoverflow.com/questions/7722177/how-do-i-map-ctrl-x-ctrl-o-to-ctrl-space-in-terminal-vim#answer-24550772 "nnoremap <C-Space> :NERDTreeToggle<CR> "nmap <C-@> <C-Space> nnoremap <silent> <Space> :NERDTreeToggle<cr> " toggle line numbers nnoremap <silent> <leader>n :set number! number?<cr> " toggle line wrap nnoremap <silent> <leader>w :set wrap! wrap?<cr> " toggle buffer (switch between current and last buffer) nnoremap <silent> <leader>bb <C-^> " go to next buffer nnoremap <silent> <leader>bn :bn<cr> nnoremap <C-l> :bn<cr> " go to previous buffer nnoremap <silent> <leader>bp :bp<cr> " https://github.com/neovim/neovim/issues/2048 nnoremap <C-h> :bp<cr> " close buffer nnoremap <silent> <leader>bd :bd<cr> " kill buffer nnoremap <silent> <leader>bk :bd!<cr> " list buffers nnoremap <silent> <leader>bl :ls<cr> " list and select buffer nnoremap <silent> <leader>bg :ls<cr>:buffer<Space> " horizontal split with new buffer nnoremap <silent> <leader>bh :new<cr> " vertical split with new buffer nnoremap <silent> <leader>bv :vnew<cr> " redraw screan and clear search highlighted items "http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting#answer-25569434 nnoremap <silent> <C-L> :nohlsearch<CR><C-L> " vimux " https://raw.githubusercontent.com/benmills/vimux/master/doc/vimux.txt nnoremap <leader>vc :VimuxPromptCommand<cr> nnoremap <leader>vl :VimuxRunLastCommand<cr> nnoremap <leader>vq :VimuxCloseRunner<cr> nnoremap <leader>vx: VimuxInterruptRunner<cr> " improved keyboard navigation nnoremap <leader>h <C-w>h nnoremap <leader>j <C-w>j nnoremap <leader>k <C-w>k nnoremap <leader>l <C-w>l " improved keyboard support for navigation (especially terminal) " https://neovim.io/doc/user/nvim_terminal_emulator.html tnoremap <Esc> <C-\><C-n> tnoremap <A-h> <C-\><C-n><C-w>h tnoremap <A-j> <C-\><C-n><C-w>j tnoremap <A-k> <C-\><C-n><C-w>k tnoremap <A-l> <C-\><C-n><C-w>l nnoremap <A-h> <C-w>h nnoremap <A-j> <C-w>j nnoremap <A-k> <C-w>k nnoremap <A-l> <C-w>l " Start terminal in insert mode au BufEnter * if &buftype == 'terminal' | :startinsert | endif nnoremap <silent> <leader>tt :terminal<cr> nnoremap <silent> <leader>tv :vnew<cr>:terminal<cr> nnoremap <silent> <leader>th :new<cr>:terminal<cr> tnoremap <C-x> <C-\><C-n><C-w>q " ctrlp.vim let g:ctrlp_map = '<c-p>' let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_working_path_mode = '' " toggle colors to optimize based on light or dark background nnoremap <leader>c :call ToggleLightDark()<cr> " ===================================== " Go " https://github.com/fatih/vim-go " ===================================== let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_fields = 1 let g:go_highlight_types = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 au FileType go nmap <Leader>gd <Plug>(go-doc) au FileType go nmap <Leader>gv <Plug>(go-doc-vertical) au FileType go nmap <Leader>gb <Plug>(go-doc-browser) au FileType go nmap <Leader>s <Plug>(go-implements) au FileType go nmap <Leader>i <Plug>(go-info) " ===================================== " vim-airline status " configure: https://github.com/vim-airline/vim-airline#user-content-extensible-pipeline " ===================================== let g:airline_theme='monochrome' " show buffers (if only one tab) "let g:airline#extensions#tabline#enabled = 1 let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 let s:hidden_all = 1 set noshowmode set noruler set laststatus=0 set noshowcmd else let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd endif endfunction nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR> ```