-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
98 lines (72 loc) · 3.29 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
" This vimrc was created on 31st March, 2019 by Monil Soni
"
" This option forces Vim to source .vimrc file if it present in working directory, thus providing a place to store project-specific configuration.
set exrc
" Since Vim will source .vimrc from any directory you run Vim from, this is a potential security hole; so, you should consider setting secure option. This option will restrict usage of some commands in non-default .vimrc files; commands that write to file or execute shell commands are not allowed and map commands are displayed.
set secure
set noswapfile
set undodir=~/.vim/undodir " All the undo files are placed in this directory
set undofile " undo previous actions even after you close and open a file
" Uncomment the following line if you use YouCompleteMe
" let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/.ycm_extra_conf.py'
syntax enable " enable syntax processing
set signcolumn=yes
set encoding=utf-8
set nocompatible
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in TAB while editing
set shiftwidth=4
set expandtab
set ruler
set number relativenumber " show line numbers
set cursorline " highlight the current line
set scrolloff=8 " always offset n number of lines from where you're editing
set showmode " see what mode you're in
set showcmd " see what commands you are typing
filetype plugin indent on " load filetype-specific indent files and plugin files
set smartindent
set colorcolumn=120
" Search down into subfolders
" Provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
set wildmenu
set wildmode=list:longest
set showmatch " highlight paranthesis matching
set incsearch " search as characters are entered
set hlsearch " highlight matches
set smartcase " searches in a case insensitive manner until a different case is encountered. Then it searches case matching
" move vertically by visual line These two allow us to move around lines visually. So if there's a very long line that gets visually wrapped to two lines, j won't skip over the 'fake' part of the visual line in favor of the next 'real' line.
nnoremap j gj
nnoremap k gk
set linebreak
set whichwrap+=<,>,h,l,[,] " move to previous/next line on reaching end of line
" when new split is opened, it opens either in bottom or on the right
set splitbelow
set splitright
set laststatus=2 " Show the name of the file always
" Making navigation simpler
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" autocmd BufNewFile *.cpp r ~/Competitive-Coding/templates/cpp_template.cpp
" Plugins stuff
" vim-plug stuff
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')
" Declare the list of plugins.
Plug 'morhetz/gruvbox'
Plug 'sheerun/vim-polyglot'
Plug 'joshdick/onedark.vim'
Plug 'mtdl9/vim-log-highlighting'
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
" Start NERDTree. If a file is specified, move the cursor to its window.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif
" color dracula
colorscheme onedark
" set background=dark " For gruvbox theme