Skip to content

Instantly share code, notes, and snippets.

@huskercane
Last active May 24, 2021 21:11
Show Gist options
  • Save huskercane/a866005544eab63a20a3b16aa37bc816 to your computer and use it in GitHub Desktop.
Save huskercane/a866005544eab63a20a3b16aa37bc816 to your computer and use it in GitHub Desktop.
My vimrc file
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" for git
Plugin 'jeetsukumaran/vim-markology'
Plugin 'sudo.vim'
Plugin 'neoclide/coc.nvim'
Plugin 'jremmen/vim-ripgrep'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'Valloric/YouCompleteMe'
Plugin 'LargeFile'
Plugin 'joshdick/onedark.vim'
Plugin 'morhetz/gruvbox'
Plugin 'tomasiser/vim-code-dark'
Plugin 'majutsushi/tagbar'
" Plugin 'SirVer/ultisnips'
Plugin 'Yggdroot/indentLine'
" for auto closing
Plugin 'Raimondi/delimitMate'
" for searching
" Plugin 'ctrlp.vim'
" Plugin 'vim-javascript'
" Plugin 'javascript-libraries-syntax'
" Plugin 'matthewsimo/angular-vim-snippets'
" Plugin 'claco/jasmine.vim'
" Plugin 'leafgarland/typescript-vim'
" type script
" Plugin 'Quramy/tsuquyomi'
Plugin 'Shougo/vimproc.vim'
" Plugin 'syntastic'
" Plugin 'buffergrep'
Plugin 'martinda/Jenkinsfile-vim-syntax'
Plugin 'tfnico/vim-gradle'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" Plugin 'Windows-PowerShell-File-Type-Plugin'
" Plugin 'Windows-PowerShell-indent-enhanced'
" Plugin 'Windows-PowerShell-Indent-File'
" Plugin 'Windows-PowerShell-Syntax-Plugin'
" Plugin 'fatih/vim-go'
" Plugin 'honza/vim-snippets'
" Plugin 'jceb/vim-orgmode'
Plugin 'nvie/vim-flake8'
Plugin 'w0rp/ale'
Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
" Plugin 'cespare/vim-toml'
" Plugin 'dyng/ctrlsf.vim'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 'skanehira/docker-compose.vim'
Plugin 'diepm/vim-rest-console'
Plugin 'b4winckler/vim-objc.git'
Plugin 'stephpy/vim-yaml'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
syn on
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
set encoding=utf-8
" set tab to 2 space and change tab to space
set tabstop=2
set shiftwidth=2
set expandtab
set smarttab
" vertical line indentation
" let g:indentLine_color_term = 239
" let g:indentLine_color_gui = '#09AA08'
" let g:indentLine_color_char = '|'
" set runtimepath+=~/.vim_runtime
" source ~/.vim_runtime/vimrcs/basic.vim
" source ~/.vim_runtime/vimrcs/filetypes.vim
" source ~/.vim_runtime/vimrcs/plugins_config.vim
" source ~/.vim_runtime/vimrcs/extended.vim
" try
" source ~/.vim_runtime/my_configs.vim
" catch
" endtry
" jovicailic.org - below from there
set undofile "Maintain undo history between sessions
set undodir=~/.vim/undodir
" let g:material_style='palenight'
" set background=dark
" colorscheme vim-material
" colorscheme codedark
" let g:airline_theme='onedark'
" colorscheme onedark
set background=dark
let g:airline_theme='gruvbox'
colorscheme gruvbox
" tagbar
nmap <F8> :TagbarToggle<CR>
" set font
set gfn=Fantasque\ Sans\ Mono\ 12,Fira\ Code,IBM\ Plex\ Mono\ 11,Hack\ 14,Source\ Code\ Pro\ 12,Bitstream\ Vera\ Sans\ Mono\ 11
" open quick fix after vim grep
augroup qf
autocmd!
autocmd QuickFixCmdPost [^i]* cwindow
autocmd QuickFixCmdPost l* cwindow
autocmd VimEnter * cwindow
augroup END
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc,*.class
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Spell checking
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
augroup configgroup
autocmd!
autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.md :call <SID>StripTrailingWhitespaces()
autocmd VimEnter * highlight clear SignColumn
autocmd FileType java setlocal noexpandtab
autocmd FileType java setlocal list
autocmd FileType java setlocal listchars=tab:+\ ,eol:-
autocmd FileType java setlocal formatprg=par\ -w80\ -T4
autocmd FileType php setlocal expandtab
autocmd FileType php setlocal list
autocmd FileType php setlocal listchars=tab:+\ ,eol:-
autocmd FileType php setlocal formatprg=par\ -w80\ -T4
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd FileType python setlocal commentstring=#\ %s
autocmd BufEnter *.cls setlocal filetype=java
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufEnter *.sh setlocal tabstop=2
autocmd BufEnter *.sh setlocal shiftwidth=2
autocmd BufEnter *.sh setlocal softtabstop=2
augroup END
" strips trailing whitespace at the end of files. this
" is called on buffer write in the autogroup above.
function! <SID>StripTrailingWhitespaces()
" save last search & cursor position
" let _s=@/
let l = line(".")
let c = col(".")
%s/\s\+$//e
" let @/=_s
call cursor(l, c)
endfunction
noremap <leader>s :call <SID>StripTrailingWhitespaces()<cr>
set laststatus=2
let g:LargeFile=12
let g:flake8_show_in_gutter=1
autocmd BufWritePost *.py call Flake8()
" change directory to files so vimgrep does not print whole path
" http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
noremap <leader>cd :cd %:p:h<CR>
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]
let g:ycm_global_ycm_extra_conf = '/home/rohits/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
autocmd FileType java setlocal omnifunc=javacomplete#Complete
nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
nmap <F5> <Plug>(JavaComplete-Imports-Add)
imap <F5> <Plug>(JavaComplete-Imports-Add)
nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
let g:coc_global_extensions = [
\ 'coc-json',
\ 'coc-pyright',
\ 'coc-html',
\ 'coc-tsserver',
\ 'coc-markdownlint',
\ ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment