-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfakevimrc
117 lines (100 loc) · 3.28 KB
/
fakevimrc
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
set nocompatible " Be iMproved
filetype plugin indent on
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
" This makes vim act like all other editors, buffers can
" exist in the background without being in a window.
" http://items.sjbach.com/319/configuring-vim-right
set hidden
"turn on syntax highlighting
syntax on
" ================ Indentation ======================
set autoindent
set smartindent
set noexpandtab
set smarttab
set shiftwidth=4
set tabstop=4
" Display tabs and trailing spaces visually
" set list listchars=tab:\ \ ,trail:·
set nowrap "Don't wrap lines
set linebreak "Wrap lines at convenient points
" ================ Folds ============================
set foldmethod=indent "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "dont fold by default
" ================ Completion =======================
set wildmode=list:longest
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
set wildignore+=*vim/backups*
set wildignore+=*sass-cache*
set wildignore+=*DS_Store*
set wildignore+=vendor/rails/**
set wildignore+=vendor/cache/**
set wildignore+=*.gem
set wildignore+=log/**
set wildignore+=tmp/**
set wildignore+=*.png,*.jpg,*.gif
"
" ================ Scrolling ========================
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
" ================ Search ===========================
set incsearch " Find the next match as we type the search
set hlsearch " Highlight searches by default
set ignorecase " Ignore case when searching...
set smartcase " ...unless we type a capital
" ================ Leader ========================
" mapleader is ignored by fakevim. Jesus Christ on a stick
" let mapleader = "\<Space>"
" ============ OS and shell based settings ================
"
" ------------------------------------------------------------------
" Regular mappings
" ------------------------------------------------------------------
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" Clear screen removes highlighting
noremap <C-L> :nohlsearch<CR><C-L>
"save file with leader
" nnoremap <Leader>w :w<CR>
"save all the files with leader
nnoremap <Space>w :saveall<CR>
"Automatically jump to end of text you pasted
vnoremap y y`]
vnoremap p p`]
nnoremap p p`]
"Copy & paste to system clipboard
vmap <Space>y "+y
vmap <Space>d "+d
nmap <Space>p "+p
nmap <Space>P "+P
vmap <Space>p "+p
vmap <Space>P "+P
nnoremap <Space>u :findusages<CR>
" switch header source
nnoremap <Space>a :A<CR>
nnoremap <Space>h :contexthelp<CR>
nnoremap gcc :comment<CR>
vnoremap gc :comment<CR>
" goto definition
nnoremap <Space>n :tag<CR>
" Visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
" reselect what was just pasted
noremap gV `[v`]
nnoremap gf :gotofile<CR>
" better to do this directly in the settings
" nnoremap <C-O> :goback<CR>
" nnoremap <C-I> :gofwd<CR>
" locate
nnoremap <Space>e :e<CR>
nnoremap <Space>s :projectsidebar<CR>