-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
90 lines (70 loc) · 1.39 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
" Vim
set nocompatible "iMproved!
set shell=bash
syntax enable
set termguicolors
set timeoutlen=200
inoremap jk <Esc>
inoremap kj <Esc>
" No swap or backup
set noswapfile
set nobackup
" Editing
set tabstop=2
set softtabstop=2
set shiftwidth=2
set smarttab
set expandtab
set autoindent
set smartindent
set encoding=utf-8
" Editor
set hidden
set number
set relativenumber
set ruler
set showcmd
set showmode
set showmatch
set wildmenu
set wildignore=*.swp,*.bak,*.pyc,*.class
set title
set novisualbell
set noerrorbells
set list
set listchars=tab:▸\ ,trail:.,extends:#
set splitright
set splitbelow
" Searching
set ignorecase
set smartcase
set incsearch
" Folding
set foldenable
set foldnestmax=2
set foldmethod=expr
" Keybindings
let mapleader=" "
" Disable hlsearch with second escape
" and when entering insert mode
nnoremap-silent <Esc> :nohl<CR>
augroup nohlOnInsert
au!
au InsertEnter * setlocal nohlsearch
au CmdlineEnter / setlocal hlsearch
au CmdlineEnter ? setlocal hlsearch
augroup END
" Arrow keys as Buffer and Tab switchers
nnoremap <UP> :tabnext<CR>
nnoremap <DOWN> :tabprev<CR>
nnoremap <LEFT> :bp<CR>
nnoremap <RIGHT> :bn<CR>
" Moving lines
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
" Add blank line with enter
nnoremap <Enter> o<ESC>