Last active
June 15, 2019 19:06
-
-
Save YourSouLi5Mine/b192e17b8c07f02335218bde5cf44e00 to your computer and use it in GitHub Desktop.
My personal vim configuration
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
" General | |
set number " Show line numbers | |
set linebreak " Break lines at word (requires Wrap lines) | |
set showbreak=+++ " Wrap-broken line prefix | |
"set textwidth=80 " Line wrap (number of cols) | |
set smartcase " Enable smart-case search | |
set ignorecase " Always case-insensitive | |
set incsearch " Searches for strings incrementally | |
set showmatch " Highlight matching brace | |
set hlsearch " Highlight all search results | |
set autoindent " Auto-indent new lines | |
set expandtab " Use spaces instead of tabs | |
set shiftwidth=2 " Number of auto-indent spaces | |
set smartindent " Enable smart-indent | |
set smarttab " Enable smart-tabs | |
set softtabstop=2 " Number of spaces per Tab | |
" Advanced | |
set ruler " Show row and column ruler information | |
set undolevels=1000 " Number of undo levels | |
set backspace=indent,eol,start " Backspace behaviour | |
set swapfile | |
set dir=~/tmp-vim | |
" Gruvbox Theme | |
set termguicolors "Enable true color" | |
set background=dark "Sets dark mode | |
" Specify a directory for plugins | |
" - For Neovim: ~/.local/share/nvim/plugged | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.vim/plugged') | |
" Make sure you use single quotes | |
" Theme | |
Plug 'morhetz/gruvbox' | |
" Directory tree | |
Plug 'scrooloose/nerdtree' | |
" Git for the directory tree | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
" Ctrl-P Finder | |
Plug 'kien/ctrlp.vim' | |
" Identation Line | |
Plug 'Yggdroot/indentLine' | |
" Emmet | |
Plug 'mattn/emmet-vim' | |
" Easy Motion | |
Plug 'easymotion/vim-easymotion' | |
" Multiple Selection | |
Plug 'terryma/vim-multiple-cursors' | |
" Surround | |
Plug 'tpope/vim-surround' | |
" Lightline | |
Plug 'itchyny/lightline.vim' | |
" GitBranch for LightLine | |
Plug 'itchyny/vim-gitbranch' | |
" Markdown Preview | |
Plug 'JamshedVesuna/vim-markdown-preview' | |
" Rails | |
Plug 'tpope/vim-rails' | |
" Vue | |
Plug 'posva/vim-vue' | |
" React | |
Plug 'mxw/vim-jsx' | |
" Git | |
Plug 'tpope/vim-fugitive' | |
" Elixir | |
Plug 'elixir-editors/vim-elixir' | |
" Coffe | |
Plug 'kchmck/vim-coffee-script' | |
" Initialize plugin system | |
call plug#end() | |
" Auto cmds | |
" Open NERDTree on default | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
" Close NERDTree if only window left open | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" Mappings | |
let mapleader = "," | |
map <leader>t :NERDTreeToggle<Enter> | |
:nnoremap <Tab> :bnext<CR> | |
:nnoremap <S-Tab> :bprevious<CR> | |
" Git Indicators | |
let g:NERDTreeIndicatorMapCustom = { | |
\ "Modified" : "✹", | |
\ "Staged" : "✚", | |
\ "Untracked" : "✭", | |
\ "Renamed" : "➜", | |
\ "Unmerged" : "═", | |
\ "Deleted" : "✖", | |
\ "Dirty" : "✗", | |
\ "Clean" : "✔︎", | |
\ 'Ignored' : '☒', | |
\ "Unknown" : "?" | |
\ } | |
" Ctrl-p map | |
let g:ctrlp_map = '<c-p>' | |
let g:ctrlp_show_hidden = 1 | |
let g:crlp_custom_ignore = 'node_modules\|DS_Store\|git\|uploads\|vendor' | |
" Indent Line character | |
let g:indentLine_char = '▏' | |
" Multiple Selection map | |
let g:multi_cursor_quit_key = '<C-z>' | |
let g:multi_cursor_prev_key = '<C-b>' | |
" Personal lightline | |
set noshowmode " Disables mode information | |
let g:lightline = { | |
\ 'colorscheme': 'landscape', | |
\ 'active': { | |
\ 'left': [ [ 'mode', 'paste' ], | |
\ [ 'gitbranch', 'readonly', 'filename', 'modified', 'linus' ] ] | |
\ }, | |
\ 'component_function': { | |
\ 'gitbranch': 'gitbranch#name', | |
\ } | |
\ } | |
" Theme Globals | |
let g:gruvbox_italic=1 | |
let g:gruvbox_contrast_dark='hard' | |
" Theme | |
colorscheme gruvbox | |
" Markdown Preview | |
let vim_markdown_preview_github=1 | |
let vim_markdown_preview_hotkey='<C-m>' | |
" map F3 to toggle search highlighting | |
nnoremap <F3> :set hlsearch!<CR> | |
" source ~/.vimrc | |
nnoremap <F7> :so ~/.vimrc<CR> | |
" start: automatically trim trailing whitespace | |
" autocmd BufWritePre * :%s/\s\+$//e | |
" Terminal in vim | |
" command Eterm :term ++curwin | |
" Double ESC to escape from terminal | |
" tnoremap <ESC><ESC> <C-\><C-n> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment