-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
65 lines (48 loc) · 1.9 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
set nocompatible " .vimrc file exists, vim will start in nocompatible mode.
syntax on
set tabstop=2
set shiftwidth=2
set expandtab
set ai " does auto indent
set number
set hlsearch
set ruler
highlight Comment ctermfg=green
"additional settings start from here
set showcmd " to show commands available in VIM; to use cmds start typing ':'
set encoding=utf-8 " the encoding that is displayed
"for searching in a file
set ignorecase " case insensitive
set smartcase " use case if any caps used
set incsearch " show match as search proceeds
set showmatch
set hlsearch " search highlighting
"settings for text width, line breaks etc
set wrap " enforcing wrapping of text
set textwidth=72 " specifying width of text
set colorcolumn=74 " specifying the colorcolumn width
set wrapmargin=0 " do not know but it works
set linebreak " breaks line, instead of having a single line for displaying
set showbreak=.. " shows a symbols specified when a line has been wrapped
set nolist " don't show any symbols at the end of a line we will use line number to figure that out
set formatoptions+=t " to wrap text on fly while typing
autocmd VimResized * | set columns=72 " to handle column width when terminals are resized
"the following will help vim beginners to use hjkl keys rather than up and down arrows
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
let mapleader = "," "mapping leader key to ','
"shortcut to split screen vertically ',w'
nnoremap <leader>w <C-w>v<C-w>l
"to navigate among the split screens use ctrl+ h,j,k,l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l