Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " neovim init file
- "
- let mapleader = ","
- if has('unnamedplus')
- set clipboard^=unnamed
- set clipboard^=unnamedplus
- endif
- if has('persistent_undo')
- set undofile
- set undodir=~/.config/vim/tmp/undo//
- endif
- set shortmess=atIsAoc
- set ignorecase
- set visualbell
- set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
- set completeopt=menu,noinsert,noselect
- " allow neovim to change cursor shape
- "let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
- "let $NVIM_TUI_ENABLE_TRUE_COLOR=1
- " formatting options and tabs/spaces
- " set formatoptions=tcqro
- set formatoptions=qrn1
- set expandtab
- set tabstop=2
- set shiftwidth=2
- set softtabstop=2
- set textwidth=80
- set title
- set list
- set listchars=tab:>.,trail:.,extends:#,nbsp:.
- " basic indentation
- au Filetype ruby,python,bash,go set cindent
- " manage external plugins
- call plug#begin('~/.config/nvim/plugged')
- Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
- Plug 'vim-syntastic/syntastic'
- Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
- Plug 'fatih/molokai'
- Plug 'tpope/vim-fugitive'
- Plug 'jlanzarotta/bufexplorer'
- Plug 'dgryski/vim-godef'
- Plug 'ctrlpvim/ctrlp.vim'
- Plug 'itchyny/lightline.vim'
- "Plug 'mattn/webapi-vim'
- Plug 'mileszs/ack.vim'
- Plug 'airblade/vim-gitgutter'
- Plug 'mattn/webapi-vim'
- Plug 'mattn/gist-vim', {'depends': 'mattn/webapi-vim'}
- Plug 'AndrewRadev/splitjoin.vim'
- Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }
- Plug 'roxma/nvim-completion-manager'
- Plug 'tpope/vim-rhubarb'
- call plug#end()
- " colors
- " allow neovim to use the original terminal colors
- set termguicolors
- set t_Co=256
- colorscheme molokai
- let g:rehash256 = 1
- set scrolloff=5
- set scrolljump=8
- set nocursorline
- set lazyredraw
- set noshowmatch
- set nocursorcolumn
- set mouse=n
- " gitgutter
- let g:gitgutter_map_keys = 0
- nmap <Leader>ad <Plug>GitGutterStageHunk
- nmap <Leader>aD <Plug>GitGutterUndoHunk
- " vim-go settings
- let g:go_fmt_command = "goimports"
- let g:go_bin_path = $HOME."/go/bin"
- let g:go_gotags_bin = $HOME."/go/bin/gotags"
- let g:go_highlight_space_tab_error = 0
- let g:go_highlight_trailing_whitespace_error = 0
- let g:go_highlight_functions = 1
- let g:go_highlight_methods = 0
- let g:go_list_type = "quickfix"
- let g:go_fmt_fail_silently = 1
- " syntastic settings
- let g:syntastic_go_checkers = ['govet', 'errcheck']
- let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
- " gist settings
- let g:gist_clip_command = 'pbcopy'
- let g:gist_detect_filetype = 1
- let g:gist_open_browser_after_post = 1
- " ctrlp
- let g:ctrlp_by_filename = 1
- let g:ctrlp_use_caching = 1
- let g:ctrlp_clear_cache_on_exit = 0
- let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
- " Syntastic
- let g:syntastic_enable_signs=1
- let g:syntastic_always_populate_loc_list = 0
- let g:syntastic_auto_loc_list = 0
- let g:syntastic_check_on_open = 0
- let g:syntastic_check_on_wq = 0
- 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_go_checkers = ['golint', 'govet', 'errcheck']
- let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
- nmap <silent> <F10> :SyntasticCheck<CR>
- " custom key bindings
- map <leader>d :NERDTreeToggle<CR>
- map <leader>s :BufExplorer<CR>
- au FileType go nmap <Leader>gd <Plug>(go-doc)
- au FileType go nmap <Leader>i <Plug>(go-info)
- " do not try to colorize huge json files
- au FileType json let g:vim_json_syntax_conceal = 0
- " let vim-go deal with tabs
- au FileType go set listchars-=tab:>. nolist
- " statusline
- let g:lightline = {
- \ 'colorscheme': 'wombat',
- \ 'active': {
- \ 'left': [ [ 'mode', 'paste' ],
- \ [ 'fugitive', 'syntastic', 'readonly', 'absolutepath', 'modified' ] ]
- \ },
- \ 'component': {
- \ 'readonly': '%{&filetype=="help"?"":&readonly?"RO":""}',
- \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
- \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
- \ },
- \ 'component_visible_condition': {
- \ 'readonly': '(&filetype!="help"&& &readonly)',
- \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
- \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
- \ },
- \ 'component_expand': {
- \ 'syntastic': 'SyntasticStatuslineFlag',
- \ },
- \ 'component_type': {
- \ 'syntastic': 'error',
- \ },
- \ 'separator': { 'left': '', 'right': '' },
- \ 'subseparator': { 'left': '|', 'right': '|' }
- \ }
- " enable syntastic in status line
- augroup AutoSyntastic
- autocmd!
- autocmd BufWritePost *.c,*.cpp,*.go call s:syntastic()
- augroup END
- function! s:syntastic()
- SyntasticCheck
- call lightline#update()
- endfunction
- noremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
- noremap <c-c> <ESC>
- noremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
- inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
- au VimLeave * set guicursor=a:ver30
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement