-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
95 lines (77 loc) · 2.15 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
set encoding=utf-8
set timeout timeoutlen=500 ttimeoutlen=100
let mapleader = "\<Space>"
nmap <leader>si :source ~/.vimrc<CR>
set nocompatible
map <leader>p \"+p
" Add stty -ixon to bashrc for this to work
nmap <C-s> :w<cr>
imap <C-s> <esc>:w<cr>
nmap 0 ^
imap jk <esc>
set relativenumber
set number
" Map double-tap space to open CtrlP
nnoremap <silent> <leader><space> :CtrlP<cr>
" Split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Higlights line when inserting
autocmd InsertEnter,InsertLeave * set cul!
set splitbelow
set splitright
set modelines=0 " Disable modelines as a security precaution
set nomodeline
" Enable incremental search: highlights matches as you type a search pattern
set incsearch
colo smyck
nmap <Leader>gs :G<CR>
nmap <Leader>gj :diffget //3<CR>
nmap <Leader>gf :diffget //2<CR>
set ttyfast
set mouse=a
set ttymouse=sgr
function! ToggleMouseSettings()
if &mouse != '' " Mouse is currently enabled
set mouse=
set ttymouse=
set nonumber
set norelativenumber
echo "Mouse and ttymouse disabled"
else
set mouse=a
set ttymouse=sgr
set number
set relativenumber
echo "Mouse and ttymouse enabled"
endif
endfunction
" Keymap to toggle mouse settings (using <leader>mt)
nmap <leader>mt :call ToggleMouseSettings()<CR>
" Cursor in terminal
" https://vim.fandom.com/wiki/Configuring_the_cursor
" 1 or 0 -> blinking block
" 2 solid block
" 3 -> blinking underscore
" 4 solid underscore
" Recent versions of xterm (282 or above) also support
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
if &term =~ '^xterm'
" normal mode
let &t_EI .= "\<Esc>[2 q"
" insert mode
let &t_SI .= "\<Esc>[6 q"
endif
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/tpope/vim-surround.git'
Plug 'https://github.com/machakann/vim-highlightedyank.git'
Plug 'https://github.com/tpope/vim-rails.git'
Plug 'https://github.com/ctrlpvim/ctrlp.vim.git'
Plug 'vim-test/vim-test'
Plug 'https://github.com/tpope/vim-commentary.git'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
call plug#end()