Skip to content

Instantly share code, notes, and snippets.

@Eveheeero
Created November 2, 2022 01:36
Show Gist options
  • Save Eveheeero/81d451a8459c75efb596f519d75dc989 to your computer and use it in GitHub Desktop.
Save Eveheeero/81d451a8459c75efb596f519d75dc989 to your computer and use it in GitHub Desktop.
My vimrc
" Install : git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" Modify Change : source %
" Install : PluginInstall
" Uninstall : Delete Plugin line and PluginClean to delete
" Other options can be found in :options and
" /usr/share/vim/vim81/doc/usr_41.txt, :command
" Create Swap and Backup Dir : mkdir ~/.vim/backup ~/.vim/swap
" input .ycm_extra_conf.py to ~/.vim/. or cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py ~/.vim/
" YCM Install - apt install build-essential cmake vim-nox python3-dev mono-complete golang nodejs default-jdk npm; cd ~/.vim/bundle/YouCompleteMe; python3 install.py --all
" Often Changes
set incsearch " Search When Typing
filetype plugin indent on " With file extension, enable matches plugin and indent
" Common
set hlsearch " Highlight Search
set nocompatible " Old Vim Not Support
set backspace=indent,eol,start " Backspace Default
set history=200 " Vim Command History Stores 200, Used by :history
set ruler " Display Now Cursor Position
set showcmd " Display -- INSERT -- Text
set wildmenu " Tab enable in status line
set cursorline " Cursor Row Highlight
set cursorcolumn " Cursor Column Highlight
syntax on " Enable Syntax Highlight
set backupdir=~/.vim/backup// " Set Backup Foler
set directory=~/.vim/swap// " Set Swap Foler
set scl=yes " Sign Column Setting
set number " Sign Column Lining
set timeoutlen=10000 " Set Command Timeout len to 10S
" Disabled
" set textwidth=140 " Normal Text textwidth
" Common With Condition
if has('mouse') " If has mouse
set mouse=a " Enable Mouse Cursor Move
endif
" Common With multi line
autocmd BufReadPost * " Restore Cursor, Last Position Jump
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Custom Command
" Different with original file with unsaved content
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
" Key Mapping
" :map to show all mapping
map W :w<Enter> " Quick Save and Exit
map Q :wq<Enter> " Quick Save
map \{ i{<Esc>ea}<Esc> " {text}
map \( i(<Esc>ea)<Esc> " (text)
map \[ i[<Esc>ea]<Esc> " [text]
map \" i"<Esc>ea"<Esc> " "text"
map \c y " Copy command is y (yank) with v (visual mode) or V (line visual mode)
map \v p " Paste command is p (before the cursor is P)
nnoremap <leader>n :NERDTreeFocus<CR> " NerdTree focus
nnoremap <C-n> :NERDTree<CR> " NerdTree open
nnoremap <C-t> :NERDTreeToggle<CR> " NerdTree toggle
nnoremap <C-f> :NERDTreeFind<CR> " NerdTree find
" Vim Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Vundle
Plugin 'gmarik/Vundle.vim'
" Theme
Plugin 'morhetz/gruvbox'
Plugin 'dracula/dracula-theme'
Plugin 'joshdick/onedark.vim'
Plugin 'gosukiwi/vim-atom-dark'
" Easymothion - Move Cursor in screen
" \\s Search one char
" \\f Search one char
" \\ss Move
" \\j Move Down
" \\k Move Up
" \\ge Move Up Word
Plugin 'Lokaltog/vim-easymotion'
" Nerdtree - File Tree
" \n :NERDTreeFocus Tree Focus
" <C-n> :NERDTree Show Tree
" <C-t> :NERDToggle Tree Toggle
" <C-f> :NERDTreeFind Tree Find
Plugin 'scrooloose/nerdtree'
" Nerdcommenter - Comment With Filetype
" \cA Comment to end
" \cl Comment to line start
" \cb Comment to line start
" \cu Uncomment line
Plugin 'scrooloose/nerdcommenter'
" Airline - Status bar
Plugin 'bling/vim-airline'
" Signify - Git Status in sign column
Plugin 'mhinz/vim-signify'
" Markdown
Plugin 'plasticboy/vim-markdown'
" Json
Plugin 'elzr/vim-json'
" YouCompleteMe - Code Autocomplete
Plugin 'Valloric/YouCompleteMe'
" Syntastic - Syntax Check
Plugin 'vim-syntastic/syntastic'
" fzf - fuzzy finder
Plugin 'junegunn/fzf'
" C/C++
Plugin 'c.vim'
Plugin 'rip-rip/clang_complete'
" Rust
Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
" Go
Plugin 'fatih/vim-go'
call vundle#end()
" Vim Vundle End
" Plugin Setting
" Theme (gruvbox)
set bg=dark " Gruvbox Dark Theme
set termguicolors " Color Error Handling
let g:gruvbox_termcolors=256 " Color Error handling
colorscheme gruvbox " Gruvbox Install
" YouCompleteMe
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
let g:ycm_semantic_triggers = {
\ 'c' : ['->', '.'],
\ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
\ 're!\[.*\]\s'],
\ 'ocaml' : ['.', '#'],
\ 'cpp,objcpp' : ['->', '.', '::'],
\ 'perl' : ['->'],
\ 'php' : ['->', '::'],
\ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
\ 'ruby' : ['.', '::'],
\ 'lua' : ['.', ':'],
\ 'erlang' : [':'],
\ 'rs' : ['::', '.', '->', '('],
\ }
" Syntastic
let g:syntastic_html_tidy_ignore_errors=[
\'proprietary attribute "ng-',
\'proprietary attribute "chart-',
\'proprietary attribute "pdk-'
\]
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_loc_list_height = 5
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_java_checkers = ['javac', 'checkstyle']
let g:syntastic_json_checkers = ['jsonlint']
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_css_checkers = ['csslint']
let g:syntastic_c_checkers = ['clang_check']
let g:syntastic_html_checkers = ['jshint']
let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
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_java_checkstyle_classpath = '~/checkstyle-7.6-all.jar'
let g:syntastic_java_checkstyle_conf_file = '~/sun_checks.xml'
highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn
" C/C++
let g:C_UseTool_cmake = 'yes'
let g:C_UseTool_doxygen = 'yes'
let g:clang_library_path = '/home/eveheeero/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/clang/lib/libclang.so' " Must be absolute path
" Rust
set hidden
let g:racer_cmd = "/home/user/.cargo/bin/racer"
let g:racer_experimental_completer = 1
let g:racer_insert_paren = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment