-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
146 lines (113 loc) · 2.94 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
"== NEOVIM SPECIFIC ======================================
set termguicolors
"== BASIC INTERFACE PREFERENCES ==========================
set nocompatible
set statusline=%f\ []\ %{fugitive#head()}
set background=dark
set shell=/bin/zsh
set splitright
set nobackup
set noswapfile
set guioptions=r " Only display a scroll bar on the right
" backspace/delete like I'm used to
set backspace=indent,eol,start
set history=100
set showcmd
set colorcolumn=80
" show matching braces/parens
set nocompatible
syntax enable
filetype on
filetype plugin on
filetype plugin indent on
set showmatch
set ruler
set number
set nowrap
set hlsearch
set cursorline
set clipboard=unnamed
" disables both audio & visual bell
set vb t_vb=
" text selection to not include character under cursor
set selection=exclusive
behave mswin
" code folding? meh.
set nofoldenable
" wrap like I'm used to
se wrap
set formatoptions=1
set lbr
" visual autocomplete for command menu
set wildmenu
" redraw only when we need to.
set lazyredraw
" == PLUGINS ==============================================
call plug#begin()
"Navigation
Plug 'preservim/nerdtree'
" Git
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-fugitive'
"Utils
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sleuth'
" Search
Plug 'mhinz/vim-grepper'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Syntax support
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'hail2u/vim-css3-syntax'
Plug 'pantharshit00/vim-prisma'
" Themes
Plug 'tristen/superman'
call plug#end()
" == PLUGIN OPTIONS =======================================
colorscheme superman
" coc
let g:coc_global_extensions = [ 'coc-tsserver' ]
nmap <leader>c <Plug>(coc-codeaction)
nmap <leader>f <Plug>(coc-fix-current)
inoremap <expr> <cr> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
" Nerdtree
set wildignore+=*.git,*.DS_Store
noremap <F2> :NERDTreeToggle<cr>
inoremap <F2> <esc>:NERDTreeToggle<cr>
let NERDTreeShowHidden=1
let NERDTreeRespectWildIgnore=1
" Grepper
let g:grepper = {}
let g:grepper.tools = ['ag']
let g:grepper.simple_prompt = 1
let g:grepper.quickfix = 1
let g:grepper.highlight = 1
nmap <leader>a :Grepper -tool ag
" == KEY BINDINGS =========================================
" Disable the arrow keys to learn the hard way
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
" Visually select text again after indentation
:vmap < <gv
:vmap > >gv
" Disable <F1> help key. I hit it all the time.
noremap <F1> <nop>
" == FUNCTIONS =============================================
" Strip whitespace from a file
function! StripWhitespace ()
exec ':%s/ \+$//gc'
endfunction
noremap ,s :call StripWhitespace()<CR>
" Swap quotations types a file
noremap ,' :%! tr \"\' \'\"<CR>
" == TABS & FORMATTING ====================================
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab