Skip to content

Instantly share code, notes, and snippets.

@madhukar93
Created June 13, 2019 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhukar93/33316a8da003de08640c8af82b085ada to your computer and use it in GitHub Desktop.
Save madhukar93/33316a8da003de08640c8af82b085ada to your computer and use it in GitHub Desktop.
init.vim
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/majutsushi/tagbar.git'
Plug 'https://github.com/altercation/vim-colors-solarized'
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 'w0rp/ale'
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'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-go', { 'do': 'make'}
Plug 'justinmk/vim-sneak'
Plug 'junegunn/seoul256.vim'
let g:seoul256_background = 233
call plug#end()
let g:python_host_prog = '/Users/madhukar/.virtualenvs/neovim2/bin/python'
let g:python3_host_prog = '/Users/madhukar/.virtualenvs/neovim3/bin/python'
"colorscheme
"colorscheme molokai
"let g:solarized_termcolors=256
"syntax enable
"set background=dark
"colorscheme solarized
if !empty($VIM_COLOR)
colorscheme $VIM_COLOR
else
colorscheme seoul256
endif
" autopairs config
let g:AutoPairsUseInsertedCount = 1
" deoplete
let g:deoplete#enable_at_startup = 1
" Go
" 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
" disable ale for python
let g:ale_pattern_options = {
\ '\.py$': {'ale_linters': [], 'ale_fixers': []},
\}
let g:ale_pattern_options = {
\ '\.go$': {'ale_linters': [], 'ale_fixers': []},
\}
let g:ale_pattern_options_enabled = 1
" Python
" disable deoplete for python as it interferes with rope completion
autocmd FileType python
\ call deoplete#custom#buffer_option('auto_complete', v:false)
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
let g:pymode_rope_show_doc_bind = '<leader>k'
" tagbar
nmap <F8> :TagbarToggle<CR>
nmap <F9> :TagbarOpen j<CR>
" my shizz
command Fixup execute "w | !fixup"
let mapleader = "\\"
nnoremap <esc> :noh<return> :lcl<return><esc>
"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