-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
115 lines (99 loc) · 3.22 KB
/
.vimrc
File metadata and controls
115 lines (99 loc) · 3.22 KB
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
" Visuals {{
syntax enable
colorscheme space-vim-dark
" https://github.com/liuchengxu/space-vim-dark/blob/master/colors/space-vim-dark.vim
" https://gitlab.com/Feehley/dotfiles/-/blob/master/bashConfigs/space-vim-dark.vim (as a backup)
let g:space_vim_dark_background=234
color space-vim-dark
set ttyfast lazyredraw "rendering of tty
set nu cursorline "Line numbers and line
set colorcolumn=80
set title mouse= "Window title and allowing mouse clicks
" set foldenable foldmethod=syntax foldlevelstart=1
"}}
" Comment Settings for space-vim-dark{{
hi Comment cterm=italic
hi Comment guifg=#5C6370 ctermfg=59
"}}
set noerrorbells vb t_vb=
" Tab and Space Settings {{
set shiftwidth=4 tabstop=4
autocmd BufRead * silent! %s/[\r \t]\+$/
"}}
" Search Settings {{
set hlsearch incsearch
set ignorecase smartcase
hi Visual term=reverse cterm=reverse guibg=Grey
"}}
" Mode Information {{
let g:currentmode={
\ 'n' : 'VIEW',
\ 'v' : 'VIS',
\ 'V' : 'VIS-LINE',
\ "\<C-V>" : 'VIS-BLOCK',
\ 'i' : 'INS',
\ 'R' : 'REP',
\ 'c' : 'CMD',
\}
"}}
" Show all options with tab {{
" https://github.com/gelguy/wilder.nvim
" https://gitlab.com/Feehley/wilder.nvim (as a backup)
let s:wilder_path = expand('~/.vim/pack/plugins/start/wilder.nvim')
if !isdirectory(s:wilder_path)
set wildmenu
set wildoptions=pum
set wildmode=longest:full,full
else
call wilder#setup({'modes': [':', '/', '?']})
call wilder#set_option('renderer', wilder#popupmenu_renderer({
\ 'highlighter': wilder#basic_highlighter(),
\ }))
endif
"}}
" Status Information {{
set laststatus=2 "Enabling status bar
set statusline=\ %{get(g:currentmode,mode(),'')}
set statusline+=\ [\ %F\ %y\ ] " filename file type
set statusline+=%= "right align
set statusline+=[%{&fileformat}\] "file format
set statusline+=\ <<\ %l/%L\ \[%p%%\]\ >>"current line/overall lines [percentage through file]
set statusline+=\ %{strftime('%T')}
"}}
"Mapping Keys {{
nnoremap <DOWN> gj
nnoremap <UP> gk
nnoremap <C-LEFT> zc
nnoremap <C-RIGHT> zo
nnoremap <F5> i<C-R>=strftime(%Y-%m-%d %H-%M-%S %z %Z --")<CR> " Note Line out of insert mode
inoremap <F5> <C-R>=strftime(%Y-%m-%d %H-%M-%S %z %Z --")<CR> " Note Line in insert mode
nnoremap <F3> :set number!<CR> # Invert Line Numbers -- remove/insert them out of insert mode
inoremap <F3> :set number!<CR> # Invert Line Numbers -- remove/insert them in of insert mode
"}}
" Grabbing Filetypes {{
let fileExt = expand('%:e')
let fileName = expand('%:t')
if (fileName != 'Makefile' && fileExt != 'mk')
set expandtab
endif
if (fileExt == 'py')
nnoremap <buffer> H :<C-u> execute "!pydoc " . expand("<cword>")<CR>
nnoremap <C-DOWN> 0i#<ESC>
nnoremap <C-UP> 0x<ESC>
elseif (fileExt == 'c' || fileExt == 'cpp')
nnoremap <buffer> H :<C-u> execute "!man " . expand("<cword>")<CR>
nnoremap <C-DOWN> 0i//<ESC>
nnoremap <C-UP> 0xx<ESC>
elseif (fileExt == 'sh' || fileExt == 'bash')
nnoremap <buffer> H :<C-u> execute "!" . expand("<cword>") " --help"<CR>
nnoremap <C-DOWN> 0i#<ESC>
nnoremap <C-UP> 0x<ESC>
endif
"}}
" Persistent Undo {{
try
set undodir=~/.vim_runtime/undodir undofile
set undolevels=100 undoreload=100
catch
endtry
"}}