-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
148 lines (116 loc) · 3.46 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
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" General
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
" following allows pathogen to manage
" 'runtimepath' for easy plug-in use
" execute pathogen#infect()
set lazyredraw " tell vim not to setredraw the screen during macros
set ruler " always show current pos
set showcmd " show cmds in bottom-right
set number relativenumber " show relative line numbers in normal mode, except current line
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" User Interface
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set complete-=i "disable
if has('mouse') " enable mouse if terminal supports it
set mouse=a "
endif
set wildmenu " autocomplete vim commands
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Colors and Visual Settings
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
"workaround for background-color erase issues with kitty term
let &t_ut=''
set background=dark
"switch between dark and light themes
nnoremap <leader><space>l :set background=light<CR>
nnoremap <leader><space>d :set background=dark<CR>
colorscheme solarized
"if has('nvim')
" colorscheme NeoSolarized
"else
" colorscheme solarized
"endif
"colorscheme wal
"colorscheme waltest
set cursorline " highlight current line
set colorcolumn=85 " vertical highlight @ N character width
if has('nvim')
else
set listchars=tab:>-,trail:-
endif
set list
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Tab settings and indentation
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab tabstop=4 shiftwidth=4 softtabstop=4 " expand tabs to 4 spaces
if has("autocmd")
filetype plugin indent on
else
set autoindent
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Miscellaneous Bindings
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
inoremap JJ jj
inoremap jj <ESC>
" following lines fix accidental
" entering of 'help' mode
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Searching & Moving
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""
set ignorecase smartcase " ignore case if search pattern
" is all lowercase; case sensitive
" if any upper case letters are present
set hlsearch showmatch incsearch " highlight searches as characters
" are typed and move cursor to match
set gdefault " default to global substitution rather than first occurence
" \<space> removes search highlighting
nnoremap <leader><space> :nohlsearch<cr>
" following lines make j and k move on visual lines
nnoremap j gj
nnoremap k gk
" following lines make <tab> move between
" matching bracket pairs outside of insert mode
nnoremap <tab> %
vnoremap <tab> %
" following lines remap B and E to move to
" beginning and end of line respectively,
" make verbs function correctly w/
" the new bindings and unbind
" the previous bindings
nnoremap B ^
nnoremap E $
nnoremap dE d$
nnoremap yE y$
nnoremap dB d^
nnoremap yB y^
nnoremap cE c$
nnoremap cB c^
" quickly edit & reload
" .vimrc
nnoremap <leader>ec :vs $MYVIMRC<CR>
nnoremap <leader>rc :source $MYVIMRC<CR>
" easier navigation of splits
nnoremap <leader>j <C-w>j
nnoremap <leader>h <C-w>h
nnoremap <leader>k <C-w>k
nnoremap <leader>l <C-w>l
"""""""""""""""""""""""""""""""""""""""""""""""""""""