-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
157 lines (139 loc) · 4.5 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
" Vimrc file cobbled from:
" - Official default: https://github.com/vim/vim/blob/master/runtime/defaults.vim
" - Vim Wikia: http://vim.wikia.com/wiki/Example_vimrc
"
" Vim-Plug - See end for individual plugin config/remap
" Auto-install vim-plug if not present
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
" Base16 - Nicer themes
Plug 'chriskempson/base16-vim'
" Lightline - Nicer status line
Plug 'itchyny/lightline.vim'
" Fzf - Nice files search
Plug '/usr/bin/fzf'
Plug 'junegunn/fzf.vim'
" Git Gutter
Plug 'airblade/vim-gitgutter'
" Multi-cursors - Subl-like
Plug 'terryma/vim-multiple-cursors'
" Vim Surround - keyword s (e.g. cs'", ysiw])
Plug 'tpope/vim-surround'
" Abolish.vim - Easy multi-match (:%Subert/{f,F}oo/{b,B}ar/g
Plug 'tpope/vim-abolish'
" Filetype specific commenting (e.g. <leander>cc)
Plug 'preservim/nerdcommenter'
" Automatically create closing pair for braces, parens, etc.
Plug 'lunarWatcher/auto-pairs', { 'tag': '*' }
" Syntastic
Plug 'vim-syntastic/syntastic'
" Rust
Plug 'rust-lang/rust.vim'
" Scala
Plug 'derekwyatt/vim-scala'
" Javascript
Plug 'pangloss/vim-javascript'
" Vim autoformat
Plug 'vim-autoformat/vim-autoformat'
" Ranger - Explorer
Plug 'francoiscabrol/ranger.vim'
" Vim Tmux Navigator - Navigate between Vim/Tmux tabs
Plug 'christoomey/vim-tmux-navigator'
" NVIM Plugins - Further configured in init.vim file
if has('nvim')
" Treesitter for better syntax-highlighting
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
"Telescope for more advanced project search
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }
" Language Server Protocol support
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'neovim/nvim-lspconfig'
" nvim-cmp for auto-completion
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
" For vsnip users.
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
" Simple git blame
Plug 'f-person/git-blame.nvim'
" Override netrw for Explorer
Plug 'rbgrouleff/bclose.vim'
endif
call plug#end()
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
" Avoid side effects when it was already reset.
if &compatible
set nocompatible
endif
" When the +eval feature is missing, the set command above will be skipped.
" Use a trick to reset compatible only when the +eval feature is missing.
silent! while 0
set nocompatible
silent endwhile
filetype plugin indent on " Automatic language based indentation
syntax on " Automatic syntax highlighting
set history=1000 " keep 1000 lines of command line history
set number " display line number on left (only for current line)
set relativenumber " display relative line numbers (for all other lines)
set showcmd " display incomplete commands
set showmatch " display matching braces
set wildmenu " display completion matches in a status line
set incsearch " incremental search highlight
" Persistent Undo
set undodir=~/.vim/undodir
set undofile
" Indentation Options
set smartindent
set autoindent
set tabstop=8
set softtabstop=0
set shiftwidth=4
set expandtab
set smarttab
" In many terminal emulators the mouse works just fine. By enabling it you
" can position the cursor, Visually select and scroll with the mouse.
if has('mouse')
set mouse=a
endif
" Split defaults
set splitbelow
set splitright
" Key Remaps
" Easier than the standard '\'
let mapleader=","
" Easier Buffer Management - "+y, allows copying to system clipboard.
" Note, `gvim` is required in order to enable this
noremap <Leader><leader> "+
" Easier Split Navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
""" Plug Configs
" Base16 theming
let base16colorspace=256 " Access colors present in 256 colorspace
colorscheme base16-tomorrow-night
" Lightline
set laststatus=2
set noshowmode
let g:lightline = {
\ 'colorscheme': 'Tomorrow_Night'
\}
" Fzf
map ; :Files<CR>
" GitGutter
set updatetime=100 " 100ms update for faster git status
" Ranger
let g:ranger_replace_netrw = 1 " open ranger when vim open a directory