Created
August 17, 2018 14:32
-
-
Save madhukar93/8e7eeb157b855e148b8e4dcbf5a64170 to your computer and use it in GitHub Desktop.
init.vim
This file contains 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
call plug#begin('~/.vim/plugged') | |
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } | |
Plug 'https://github.com/tpope/vim-sensible' | |
Plug 'https://github.com/tpope/vim-surround' | |
Plug 'https://github.com/tpope/vim-repeat' | |
Plug 'https://github.com/kien/ctrlp.vim' | |
Plug 'https://github.com/vim-scripts/auto-pairs-gentle' | |
Plug 'https://github.com/airblade/vim-gitgutter' | |
Plug 'https://github.com/eagletmt/ghcmod-vim.git' | |
"Plug 'https://github.com/c0r73x/neotags.nvim.git' < using tagbar instead | |
Plug 'https://github.com/majutsushi/tagbar.git' | |
"Plug 'https://github.com/neomake/neomake' < using ale instead | |
Plug 'https://github.com/altercation/vim-colors-solarized' | |
Plug 'https://github.com/neovimhaskell/haskell-vim' | |
Plug 'https://github.com/vim-airline/vim-airline' | |
Plug 'https://github.com/klen/python-mode', {'branch': 'develop'} "https://github.com/python-mode/python-mode/issues/783 | |
Plug 'https://github.com/editorconfig/editorconfig-vim' | |
Plug 'sebdah/vim-delve' | |
Plug 'w0rp/ale' | |
Plug 'zchee/deoplete-go', { 'do': 'make'} | |
Plug 'nelstrom/vim-visual-star-search' | |
Plug 'pearofducks/ansible-vim', { 'do': 'cd ./UltiSnips; python2 generate.py' } | |
Plug 'stephpy/vim-yaml' | |
Plug 'whatyouhide/vim-gotham' | |
Plug 'endel/vim-github-colorscheme' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'Yggdroot/indentLine' | |
if has('nvim') " from the deoplete readme | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
else | |
Plug 'Shougo/deoplete.nvim' | |
Plug 'roxma/nvim-yarp' | |
Plug 'roxma/vim-hug-neovim-rpc' | |
endif | |
let g:deoplete#enable_at_startup = 1 | |
call plug#end() | |
"colorscheme | |
"colorscheme molokai | |
"let g:solarized_termcolors=256 | |
"syntax enable | |
"set background=dark | |
"colorscheme solarized | |
if !empty($VIM_COLOR) | |
colorscheme $VIM_COLOR | |
else | |
colorscheme gotham256 | |
endif | |
" autopairs config | |
let g:AutoPairsUseInsertedCount = 1 | |
" Neomake config -- neomake not being used in favor of ale | |
" autocmd! BufWritePost * Neomake | |
" let g:neomake_open_list = 2 | |
" https://hackernoon.com/my-neovim-setup-for-go-7f7b6e805876 | |
au FileType go set noexpandtab | |
au FileType go set shiftwidth=4 | |
au FileType go set softtabstop=4 | |
au FileType go set tabstop=4 | |
let g:go_highlight_build_constraints = 1 | |
let g:go_highlight_extra_types = 1 | |
let g:go_highlight_fields = 1 | |
let g:go_highlight_functions = 1 | |
let g:go_highlight_methods = 1 | |
let g:go_highlight_operators = 1 | |
let g:go_highlight_structs = 1 | |
let g:go_highlight_types = 1 | |
let g:go_auto_sameids = 1 | |
let g:go_fmt_command = "goimports" | |
" Enable integration with airline. | |
let g:airline#extensions#ale#enabled = 1 | |
" from vim-go-tutorial | |
" save on make command | |
set autowrite | |
" from http://howivim.com/2016/fatih-arslan/ | |
" Search mappings: These will make it so that going to the next one in a | |
" search will center on the line it's found in. | |
nnoremap n nzzzv | |
nnoremap N Nzzzv | |
" Visual Mode */# from Scrooloose {{{ | |
function! s:VSetSearch() | |
let temp = @@ | |
norm! gvy | |
let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g') | |
let @@ = temp | |
endfunction | |
vnoremap * :<c-u>call <sid>vsetsearch()<cr>//<cr><c-o> | |
vnoremap # :<c-u>call <sid>vsetsearch()<cr>??<cr><c-o> | |
" trim whitespace on save | |
au BufWritePre * :%s/\s\+$//e | |
" http://stackoverflow.com/a/23696166/2140732 | |
" don't jump while searching with * | |
nnoremap * *`` | |
" keep the cursor position when switching buffers | |
augroup CursorPosition | |
autocmd! | |
autocmd BufLeave * let b:winview = winsaveview() | |
autocmd BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif | |
augroup END | |
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc | |
" pymode | |
" TODO: configure switching b/w python 2 and 3 syntax checking | |
let g:pymode_rope = 1 | |
let g:pymode_lint_on_fly = 1 | |
let g:pymode_lint_message = 1 | |
let g:pymode_virtualenv = 1 | |
let g:pymode_options_colorcolumn = 0 | |
let g:pymode_rope_goto_definition_bind = '<leader>d' | |
"let g:pymode_rope_completion = 1 | |
"let g:pymode_rope_complete_on_dot = 1 | |
"let g:pymode_rope_autoimport = 1 | |
" vim-go | |
let g:go_fmt_command = "goimports" | |
" tagbar | |
nmap <F8> :TagbarToggle<CR> | |
" my shizz | |
let mapleader = "\\" | |
"set relativenumber | |
set number | |
set tw=80 | |
set ignorecase | |
set smartcase | |
set smarttab | |
set smartindent | |
set autoindent | |
set softtabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set incsearch | |
set history=1000 | |
" set clipboard=unnamedplus,autoselect | |
set completeopt=menuone,menu,longest | |
set wildignore+=*\\tmp\\*,*.swp,*.swo,*.zip,.git,.cabal-sandbox,.pyc | |
set wildmode=longest,list,full | |
set wildmenu | |
set completeopt+=longest | |
set cmdheight=1 | |
" from neotags README | |
set regexpengine=1 | |
" Use <F2> to toggle between 'paste' and 'nopaste' | |
set pastetoggle=<F2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment