-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
149 lines (119 loc) · 4.69 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
137
138
139
140
141
142
143
144
145
146
147
148
149
" .vimrc (Vim configuration file)
" Author: Ali Moreno <alimoreno.info>
" Last update: 2013/05/25
" Using:
" pathogen by Tim Pope
" vim-neatstatus by Lukasz Grzegorz Maciak
" molokai by Tomas Restrepoi
" python-mode by Kirill Klenov
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General Setup
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Automatic reloading of .vimrc
autocmd! bufwritepost .vimrc source %
" Setup Pathogen to manage your plugins
" mkdir -p ~/.vim/autoload ~/.vim/bundle; \
" curl -so ~/.vim/autoload/pathogen.vim \
" https://raw.github.com/tpope/vim-pathogen/master/autoload/patogen.vim
" Now you can install any plugin into a .vim/bundle/plugin-name/ folder
" For example: cd ~/.vim/bundle/ ; git pull ...
call pathogen#infect()
set nocompatible " Not vi compatibile (affects other settings)
filetype off
filetype plugin indent on " 'plugin': Enables file-specific plugins
" 'indent': Indent files
" 'on': Enables filetype detection
" Disable backup and swap files, they trigger too many events for file system
" watchers
set nobackup
set nowritebackup
set noswapfile
" Setting history and undolevels
set history=500
set undolevels=500
" Flash screen in place of beeps
"set vb t_vb=
" Searchs behavior
set hlsearch " Highlight search term in text
set incsearch " Search as you type
set ignorecase " Make search strings case insensitive
set smartcase " If one character is upper-case, it's case sensitive
" Mouse and backspace
set mouse=a "on OSX press Alt and click
"set bs=2 "make backspace behave like normal again
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Editing
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" No TABs but spaces
set tabstop=2 " Sets tabs to 2 spaces
set softtabstop=2 " Treats four spaces as one tab
set shiftwidth=2 " Use '<' and '>' keys to indent/unindent 4 spaces
set shiftround " Use multiple of shiftwidth when indenting with
" '<' and '>'
set smarttab " Use 'shiftwidth' setting at start of lines
set expandtab " Inserts four spaces with the tab key
set autoindent
"set backspace=indent,eol,start " Backspace over everything in insert mode
" Better copy & paste
"set pastetoggle=<F2>
set clipboard=unnamed
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Remappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Rebind <Leader> key
let mapleader = "," " Change the mapleader from '\' to ','
" Quicksave command
noremap <C-Z> :update<CR>
vnoremap <C-Z> <C-C>:update<CR>
inoremap <C-Z> <C-O>:update<CR>
" Quick quit command
noremap <Leader>e :quit<CR> "Quit current window
noremap <Leader>E :qa!<CR> "Quit all windows
" Simple window navigation. Bind Ctrl+<movement> keys to move arround the
" windows, instead using Ctrl+w + <movement>
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <C-h> <C-w>h
" Easier moving between tabs
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
" Removes highlight of your last search. Bind nohl.
noremap <C-n> :nohl<CR>
vnoremap <C-n> :nohl<CR>
lnoremap <C-n> :nohl<CR>
" Sort function key
vnoremap <Leader>s :sort<CR>
" Easier moving of code blocks
vnoremap < <gv " Better indentation
vnoremap > >gv " Better indentation
" Easier formatting of paragraphs
vmap Q gq
vmap Q gqap
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Appearance
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Show whitespace. MUST be inserted BEFORE the colorscheme command.
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
au InsertLeave * match ExtraWhitespace /\s\+$/
" Color scheme
set t_Co=256
colorscheme molokai
"set background=dark " Enable when using the console version
" Useful setups
syntax on " Enable syntax highlighting
set number " Show (absolute) line numbers
"set relativenumber " Show (relative) line numbers
set tw=79 " Width of document (used by gd)
set nowrap " Don't automatically wrap on load
set fo-=t " Don't automatically wrap text when typing
set cul " Show cursor line
set colorcolumn=80
"highlight ColorColumn ctermbg=154 " Green
"highlight ColorColumn ctermbg=250 " Light grey
highlight ColorColumn ctermbg=8 " Grey
"set title " Set the terminal's tite
set gfn=Monospace\ 11 " Font type and size for gvim
" ============================================================================
" Python IDE Setup
" ============================================================================