-
Notifications
You must be signed in to change notification settings - Fork 0
/
.test-vimrc
184 lines (141 loc) · 5.23 KB
/
.test-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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
let mapleader="," " leader is comma
set nocompatible " do not turn off VIM enhancements
filetype plugin indent on " You can enable loading the plugin files for specific file types with
syntax on " Vim to overrule your settings with the defaults
set visualbell " flash when there is a mistake
set errorbells " Beep or flash screen on errors
set encoding=utf-8 " character encoding
set updatetime=100 " for gitgutter
set splitbelow " how do you want your windows split
set splitright
set showcmd " show command
set showmatch " matching brackets
set ttyfast " speed scrolling in Vim
set list
set lcs=trail:-
set scrolloff=11 " keep the cursor at middle of screen
set iskeyword=@,48-57,192-255 " what is considered words in Vim
set foldmethod=indent " how do you want the method for fold
set nofoldenable " files are normal when opened, not folded
set nowrap " if current line passes screen width, continue typing on same line
set noshiftround " Round indent to multiple of 'shiftwidth'.
set autoindent " indent like previous line
set smartindent
set expandtab " don't use actual tab character
set shiftwidth=4 " indenting is 4 spaces
set softtabstop=4
set sidescroll=10
set lazyredraw
set tabline=%{strftime('%c')}
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}
set laststatus=2
set number " line numbers
set mouse=a " enable mouse usage
set backspace=indent,eol,start
set history=1000
set undolevels=1000
set ignorecase " ignore case when searching
set incsearch " incremental search
set hlsearch " highlight matching search patterns
nnoremap ; :
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>
nnoremap mm M
nnoremap <Left><Left> 0
nnoremap <Right><Right> $
nnoremap <M-Left> 0
nnoremap <M-Right> $
nnoremap <ESC>:w<CR>
" alt + h = ˙
nnoremap ˙ 0
" alt + l = ¬
nnoremap ¬ $
" key mapping in NORMAL mode to remove highlighted words from search results
nnoremap no :noh<return><esc>
" key mapping in NORMAL mode to delete current line
nnoremap - dd
" key mapping in NORMAL mode to open a vertical split blank file
nnoremap <leader>b <ESC>:vsp blank<CR>
" key mapping to move to previous window with left-key-arrow + tab
nnoremap <Left><tab> :tabprevious<CR>
" key mapping to move to next window
nnoremap <tab> :tabnext<CR>
cnoreabbrev <expr> e ((getcmdtype() is# ':' && getcmdline() is# 'e')?('tabe'):('e'))
inoremap ds $
inoremap jk <ESC>
inoremap JK <ESC>
" ctrl + shift + s
inoremap <ESC>:w<CR>
" alt + z
inoremap Ω <ESC>0i
" alt + x
inoremap ≈ <ESC>$a
inoremap <C-n> <C-x><C-o>
set number relativenumber " show current line number with relative numbers above and below
set cursorline
" we want comments to be italicized
highlight Comment cterm=italic gui=italic
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/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')
Plug 'ayu-theme/ayu-vim' " or other package manager
Plug 'Yggdroot/indentLine'
Plug 'sickill/vim-monokai'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ap/vim-css-color'
Plug 'sainnhe/vim-color-forest-night'
Plug 'rhysd/vim-syntax-christmas-tree'
Plug 'capaldo/boogiewoogie'
Plug 'catppuccin/nvim', {'as': 'catppuccin'}
Plug 'folke/tokyonight.nvim'
Plug 'liuchengxu/space-vim-theme'
Plug 'savq/melange'
call plug#end()
" vim airline settings
" vim airline theme settings
let g:airline_theme='google_light'
" git gutter settings
nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
endfunction
set statusline+=%{GitStatus()}
" settings for ayu colorscheme
set termguicolors " enable true colors support
let ayucolor="dark" " for dark version of theme
let ayucolor="mirage" " for mirage version of theme
let ayucolor="light" " for light version of theme
" Set contrast.
" This configuration option should be placed before `colorscheme everforest`.
" Available values: 'hard', 'medium'(default), 'soft'
let g:everforest_background = 'soft'
colorscheme boogiewoogie
colorscheme ayu
colorscheme monokai
colorscheme everforest
set background=light
colorscheme space_vim_theme
colorscheme tokyonight
" settings for indentline plugin
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
" Show syntax highlighting groups for word under cursor
nmap <C-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
if has('nvim')
let path = expand('<sfile>:p:h')
execute 'source ' path . '/init.vim'
endif