-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvimrc_main
More file actions
127 lines (95 loc) · 5.94 KB
/
Copy pathvimrc_main
File metadata and controls
127 lines (95 loc) · 5.94 KB
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
set nocompatible "don't need to keep compatibility with Vi
filetype plugin indent on "enable detection, plugins and indenting in one step
syntax on "Turn on syntax highlighting
set background=dark "make vim use colors that look good on a dark background
set showcmd "show incomplete cmds down the bottom
set showmode "show current mode down the bottom
set foldenable "enable folding
set showmatch "set show matching parenthesis
"set noexrc " don't use the local config
set virtualedit=all "allow the cursor to go in to "invalid" places
set incsearch "find the next match as we type the search
set hlsearch "hilight searches by default
set ignorecase "ignore case when searching
set shiftwidth=2 "number of spaces to use in each autoindent step
set tabstop=2 "two tab spaces
set softtabstop=2 "number of spaces to skip or insert when <BS>ing or <Tab>ing
set expandtab "spaces instead of tabs for better cross-editor compatibility
set smarttab "use shiftwidth and softtabstop to insert or delete (on <BS>) blanks
set cindent "recommended seting for automatic C-style indentation
set autoindent "automatic indentation in non-C files
set nowrap "no wrapping
set copyindent "copy the previous indentation on autoindenting
set backspace=indent,eol,start "allow backspacing over everything in insert mode
set noerrorbells "don't make noise
set shiftround "when at 3 spaces, and I hit > ... go to 4, not 5
"set cursorline "underline the current line in the file
"set cursorcolumn "highlight the current column. Visible in GUI mode only.
set wildmenu "make tab completion act more like bash
set wildmode=list:longest "tab complete to longest common string, like bash
"set mouse-=a "disable mouse automatically entering visual mode
"set mouse=a "Enable mouse support in the terminal VIM and activate visual mode with dragging
set mouse=v
set wrap! "Word wrap on
set bs=2
set number "Show line numbers
set hidden "allow hiding buffers with unsaved changes
set cmdheight=2 "make the command line a little taller to hide "press enter to viem more" text
imap ii <Esc> "Exit insert mode with ii
set backupdir=$HOME/.vim/backup//
set directory=$HOME/.vim/backup//
let mapleader = "," "remap leader to ',' which is much easier than '\'
" Open NERDTree with [,d]
map <Leader>d :NERDTreeToggle<CR> :set number<CR>
" double percentage sign in command mode is expanded
" to directory of current file - http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <Leader>f :CtrlP<CR>
" Exclude files from ctrl-p finder
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
" Pasting support
set pastetoggle=<F2> " Press F2 in insert mode to preserve tabs when pasting from clipboard into terminal
map <F3> :tabp<CR> " next tab
map <F4> :tabn<CR> " previous tab
" Ack in Project
map <Leader>A :AckG
map <Leader>a :Ack
colorscheme desert
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
" | | | | | | | | | | |
" | | | | | | | | | | + current
" | | | | | | | | | | column
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in
" | | | | | | | square brackets
" | | | | | | +-- current fileformat
" | | | | | +-- number of lines
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- rodified flag in square brackets
" +-- full path to file in the buffer
" }
" Use a bar-shaped cursor for insert mode, even through tmux.
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" vim clojure
let vimclojure#HighlightBuiltins=1 " Highlight Clojure's builtins
let vimclojure#ParenRainbow=1 " Rainbow parentheses
" vimux configs
" Run the current file with rspec
map <Leader>rb :call RunVimTmuxCommand("clear; rspec " . bufname("%"))<CR>
" Prompt for a command to run
map <Leader>rp :PromptVimTmuxCommand<CR>
" Prompt for a command to run
map <Leader>vp :PromptVimTmuxCommand<CR>
" If text is selected, save it in the v buffer and send that buffer it to tmux
vmap <Leader>vs "vy :call RunVimTmuxCommand(@v)<CR>
" Select current paragraph and send it to tmux
nmap <Leader>vs vip<LocalLeader>vs<CR>