-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
155 lines (129 loc) · 3.92 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
"vundle settings
set nocompatible "removes backwards compatibility with vi
set backspace=indent,eol,start " more powerful backspacing
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'jamessan/vim-gnupg'
Plugin 'nanotech/jellybeans.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'davidhalter/jedi-vim'
Plugin 'matze/vim-lilypond'
Plugin 'sjl/gundo.vim'
Plugin 'mhinz/vim-signify'
Plugin 'vlime/vlime'
Plugin 'kovisoft/paredit'
Plugin 'junegunn/rainbow_parentheses.vim'
Plugin 'sjl/badwolf'
call vundle#end()
"powerline settings
let $PYTHONPATH='/usr/lib/python3.9/site-packages'
set laststatus=2 "removes default vim status line
set t_Co=256
let g:Powerline_symbols = 'fancy'
set termencoding=utf-8
let g:airline_powerline_fonts=1
set guifont=SourceCodePro
set noshowmode
"colorscheme settings
colorscheme jellybeans "this sets the colorscheme'
let g:jellybeans_overrides = {
\ 'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\}
"colorscheme badwolf
"
"
"usability settings
"
set number
set autoindent
set relativenumber "changes lh line numbering to relative
set ignorecase "search ignores case when using lowercase
set smartcase "search follows uppercase as case-sensitive
set incsearch "these three lines work to highlight search results
set showmatch
set hlsearch
set gdefault "when substituting with the form :%s/foo/bar it now replaces every occurence on the line
set clipboard=unnamedplus "sets the x clipboard as the default clipboard
" keybinds
"move vertically by visual line
nnoremap j gj
nnoremap k gk
let mapleader = "," "changes leader key to comma
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
vnoremap <up> <nop>
vnoremap <down> <nop>
vnoremap <left> <nop>
vnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
"open .vimrc in new split for editing
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
"source the newly edited .vimrc
nnoremap <leader>sv :source $MYVIMRC<cr>
"open NERDTree
nmap <leader>n :NERDTree<cr>
"surround a word with ()
nnoremap <leader>( viw<esc>a)<esc>hbi(<esc>lec
nnoremap <leader>) viw<esc>a)<esc>hbi(<esc>lec
"surround a word with[]
nnoremap <leader>[ viw<esc>a]<esc>hbi[<esc>lec
nnoremap <leader>] viw<esc>a]<esc>hbi[<esc>lec
"surround a word with {}
nnoremap <leader>{ viw<esc>a}<esc>hbi{<esc>lec
nnoremap <leader>} viw<esc>a}<esc>hbi{<esc>lec
"remap jk to esc
inoremap jk <esc>
"go to beginning of line
nnoremap H ^
"go to end of line
nnoremap L $
"remap splits navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"remaps space to open close folds
set foldmethod=indent
set foldlevelstart=99
nnoremap <space> za
vnoremap <space> zf
"gundo
nnoremap <leader>g :GundoToggle<CR>
"save all open buffers when focus is lost
au FocusLost * :wa
"set python tabs
set tabstop=4 " number of visual spaces per tab
set shiftwidth=4
set softtabstop=4
set expandtab " turns tabs into spaces
"configure python to have an comment shortcut
autocmd FileType python let maplocalleader = ","
autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
autocmd FileType vim let maplocalleader = ","
autocmd FileType vim nnoremap <buffer> <localleader>c I"<esc>
"syntax highlighting
syntax on
set list listchars=tab:▷⋅,trail:⋅,nbsp:⋅
set statusline=%F%m%r%h%w\ [FILETYPE=%Y\ %{&ff}]\
\ [%l/%L\ (%p%%)
filetype plugin indent on
"python settings
au FileType py set autoindent
au FileType py set smartindent
au FileType py set textwidth=79 " PEP-8 Friendly
au BufRead,BufNewFile *.gabc set filetype=gabc
"this command configures F5 to save and recompile in tex documents
autocmd FileType tex map <f5> :w<enter>:! lualatex %<enter>:! zathura *.pdf<enter>
"toggle lh line numbers & automatic indenting for all filetypes
"
au FileType lisp RainbowParentheses
"settings for mutt
au BufRead /tmp/mutt-* set tw=72