-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·172 lines (130 loc) · 5.44 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
"------------------------------------------------------------------------------
" Personal Vim Configuration
"------------------------------------------------------------------------------
" setting relative line numbering
set number relativenumber
" plugin install
" section----------------------------------------------------------------------
" let g:plugs_disabled = ['vim-airline','vim-table-mode','nerdcommenter','vim-easy-align']
let g:plugs_disabled = []
call plug#begin('~/.vim/plugged')
" commenting plugin
Plug 'scrooloose/nerdcommenter'
" " airline statusbar
Plug 'vim-airline/vim-airline'
" vim table mode
Plug 'dhruvasagar/vim-table-mode'
" vim-easy-align
Plug 'junegunn/vim-easy-align'
" vim-airline themes
Plug 'vim-airline/vim-airline-themes'
" call plug_disable#commit()
call plug#end()
" setting leader key
let mapleader = " "
" setting colorscheme
let fortran_free_source=1
syntax on
colorscheme seti
" Provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
set wildmenu
" set encoding
set encoding=utf-8
" set shiftwidth
set shiftwidth=4
" incremental search
" highlighting-----------------------------------------------------------------
set incsearch
" open new files in the same directory as the open file; mainly in gvim
set autochdir
" automatic indentation
set autoindent
" Remove trailing whitespace on
" save-------------------------------------------------------------------------
autocmd BufWritePre * :call generalVimFunctions#CleanBuffer()
" enable smart search - case-insensitivity search - case-sensitive when having upper case letters in search string
set ignorecase
set smartcase
" smart tabbing with
" spaces-----------------------------------------------------------------------
set smarttab
set tabstop=4
" " enable mouse in
" " vim--------------------------------------------------------------------------
" set mouse=a
" disable mouse in
" vim--------------------------------------------------------------------------
set mouse-=a
" set current line and column
" highlighting-----------------------------------------------------------------
set cursorline
set cursorcolumn
" fix splitting
" direction--------------------------------------------------------------------
set splitbelow splitright
" " set GUI
" " options----------------------------------------------------------------------
set guioptions-=m " remove menu bar
set guioptions-=T " remove toolbar
set guioptions-=r " remove right-hand scroll bar
set guioptions-=L " remove left-hand scroll bar
" set color column margin
set colorcolumn=80
" show commands entered in normal mode at lower right corner
set showcmd
" nerd commenter
" options----------------------------------------------------------------------
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1
" Enable NERDCommenterToggle to check all selected lines is commented or not
let g:NERDToggleCheckAllLines = 1
" " custom statusline
" " option-----------------------------------------------------------------------
" set laststatus=2 " enabling statusline in single buffer also
" set statusline=%<%f " filename
" set statusline+=\ \ %y%r%m " file type, readonly notifier and modifier flag
" set statusline+=\ %=\ \ [%l\/%L] " line number / total number of lines
" set statusline+=\ \Col:\ %-4c\ BufferNo:\ %n" current column number
" header line custom call
" function---------------------------------------------------------------------
nnoremap <leader>hl :call generalVimFunctions#HoriDash()<cr>
" custom tab converting
" function---------------------------------------------------------------------
nnoremap <leader>rt :call generalVimFunctions#ConvertTab()<cr>
" vim-airline
" customizations---------------------------------------------------------------
let g:airline_section_c = '%<%f'
let g:airline_powerline_fonts = 1
" Latex filetype, changing default plaintex to tex
" format-----------------------------------------------------------------------
autocmd BufNew,FileType plaintex exec ":set filetype=tex"
" setting filetype to cpp mainly for OpenFOAM
" files------------------------------------------------------------------------
nnoremap <leader>fc :set filetype=cpp<cr>
" setting filetype to java for Processing
" files------------------------------------------------------------------------
nnoremap <leader>fj :set filetype=java<cr>
" vim-table plugin
" options----------------------------------------------------------------------
let g:table_mode_corner='|' " this enables markdown type table corner
" Enable and disable auto commenting on next line when pressing
" enter------------------------------------------------------------------------
" setlocal formatoptions-=cro " disables that feature
" set formatoptions-=o " disables that feature
" setlocal formatoptions=cro " enables that feature
" tried to remove from core, but it is repetitive and following is a better
" solution it seems
autocmd Filetype * set formatoptions-=o
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
set backspace=2