-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
136 lines (120 loc) · 3.77 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
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
scriptencoding utf-8 " Use UTF-8
set autoindent
set autowrite "auto save before make/shell commands
set backspace=2 "let backspace delete tabs and newlines
set backupdir=~/tmp " where to put backup file
set cf "enable error files & jumping
set cindent
set clipboard+=unnamed " turns out I do like is sharing windows clipboard
set completeopt=menu,longest "omni complete
set cpoptions=aABcsFsn
set cursorline " highlight active line
set display+=lastline
set directory=~/tmp " directory is the directory for temp file
set encoding=utf-8
set gdefault "replace all occurrences in line
set hidden
set history=1000
set ignorecase " search ignoring case
set incsearch "turn on incremental search
set nobackup
set nocompatible
set noexpandtab
set nohlsearch
set noswapfile
set nowrap
set nowritebackup
set number "show line numbers
set scrolloff=1
set shiftwidth=2
set shortmess=atTI
set showmode
set sidescroll=1
set sidescrolloff=2
set smartcase " but respect case whenever I type a capital letter
set smartindent
set smarttab
set softtabstop=2
set spelllang=en,el "Enable spell check in both English and Greek
set spellsuggest=9
set tabstop=2
set title "correct the window caption
set visualbell t_vb=
set wildmenu
set wildmode=full
set wrapscan " Set the search scan to wrap around the file
let g:load_doxygen_syntax=1 "enable doxygen
filetype on " detect the type of file
filetype plugin on " load file type plug ins
filetype indent on " Enable file type-specific indenting and plug ins
syntax enable
set background=light
let g:solarized_termcolors=256
colorscheme solarized
"enable match it
:source $VIMRUNTIME/macros/matchit.vim
autocmd BufWritePost .vimrc source $MYVIMRC
" Rakefile, Gemfile are Ruby
autocmd BufRead,BufNewFile {Gemfile,Rakefile,config.ru} set ft=ruby
autocmd BufRead,BufNewFile *.slim set ft=slim
" Syntax of these languages is fussy over tabs Vs spaces
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType html,yaml,css setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
"""""""""""""""""""""
""keyboard
let mapleader=","
" Visually select the text that was last edited/pasted
nmap gV `[v`]nmap <C-s> :w<cr>
imap <S-cr> <esc>O
imap <C-cr> <esc>o
nmap <S-cr> O<esc>
nmap <C-cr> o<esc>
inoremap <S-Space> <esc>bi:<esc>ea =>
inoremap <cr> <C-g>u<cr>
"move selection one line down and reselect
vmap <silent> <C-j> ]egv
"move selection one line up and reselect
vmap <silent> <C-k> [egv
"move current line down by one
nmap <silent> <C-j> ]e
"move current line up by one
nmap <silent> <C-k> [e
nmap <leader>v :edit $MYVIMRC<cr>
let g:fuf_modesDisable = []
let g:fuf_mrufile_maxItem = 300
let g:fuf_mrucmd_maxItem = 400
nmap <silent> <leader>ff :FufFileWithFullCwd<cr>
nmap <silent> <leader>fb :FufBuffer<cr>
nmap <silent> <leader>fr :FufMruFile<cr>
nmap <silent> <leader>fc :FufMruCmd<cr>
nmap <silent> <leader>fo :FufFileWithCurrentBufferDir<cr>
nmap <silent> <leader>fj :FufJumpList<cr>
nmap <silent> <leader>fx :FufQuickfix<cr>
nmap <silent> <leader>l :set list!<cr>
nmap <silent> <leader>h :set hlsearch!<cr>
nmap <silent> <leader>n :set number!<cr>
nmap <silent> <leader>w :set wrap!<cr>
nmap <silent> <leader>s :set spell!<cr>
nmap <silent> <C-Tab> :bn<cr>
nmap <silent> <S-C-Tab> :bp<cr>
nmap <C-s> :w<cr>
nmap Y y$
nnoremap <space> :
vnoremap <space> :
imap <C-Space> <C-x><C-o>
imap <M-=> <%= -%><esc>hhhi
imap <M--> <% -%><esc>hhhi
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
cnoremap <M-b> <S-Left>
cnoremap <M-f> <S-Right>
"""""""""""""""""""""
let ruby_operators = 1
command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis