comparison vim/.vimrc @ 9:d3c383a0a5e8

New settings inspired from recent blog posts on the net.
author Brian Neal <bgneal1@rockwellcollins.com>
date Wed, 19 Sep 2012 15:07:55 -0500
parents ff60fbc930de
children b113527fa5d1
comparison
equal deleted inserted replaced
8:097c95760fd0 9:d3c383a0a5e8
6 set nobackup 6 set nobackup
7 set tabstop=3 7 set tabstop=3
8 set shiftwidth=3 8 set shiftwidth=3
9 set backspace=indent,eol,start 9 set backspace=indent,eol,start
10 set expandtab 10 set expandtab
11 set textwidth=120 11 set textwidth=79
12 set number 12 set number
13 set ruler 13 set ruler
14 set history=1000 14 set history=1000
15 set encoding=utf-8 15 set encoding=utf-8
16 set showcmd 16 set showcmd
17 17
18 " CtrlP related settings 18 " CtrlP related settings
19 " set wildignore+=.git\*,.hg\*,.svn\*,*.d,*.dbo,*.o,*.ti 19 " set wildignore+=.git\*,.hg\*,.svn\*,*.d,*.dbo,*.o,*.ti,*.ii,*.swp,*.pyc
20 set wildignore+=*/.git/*,*/.hg/*,*/.svn/* 20 set wildignore+=*/.git/*,*/.hg/*,*/.svn/*
21 let g:ctrlp_working_path_mode = 2 21 let g:ctrlp_working_path_mode = 2
22 22
23 " This allows % to toggle on if/elsif/else/end, XML tags, & more 23 " This allows % to toggle on if/elsif/else/end, XML tags, & more
24 runtime macros/matchit.vim 24 runtime macros/matchit.vim
32 set title 32 set title
33 33
34 " This puts more context around the cursor when scrolling 34 " This puts more context around the cursor when scrolling
35 set scrolloff=3 35 set scrolloff=3
36 36
37 " let g:netrw_sort_sequence = "[\/]$,*,\.bak$,\.o$,\.info$,\.swp$,\.obj$" 37 let g:netrw_sort_sequence = "[\/]$,*,\.bak$,\.o$,\.info$,\.swp$,\.obj$"
38 38
39 syntax on 39 syntax on
40 filetype on 40 filetype on
41 filetype plugin on 41 filetype plugin on
42 filetype indent on 42 filetype indent on
43 set hlsearch 43 set hlsearch
44 set incsearch 44 set incsearch
45 45
46 " highlight trailing spaces 46 " highlight trailing spaces
47 let c_space_errors = 1 47 let c_space_errors = 1
48 " let python_space_error_highlight = 1 48 let python_space_error_highlight = 1
49 49
50 set background=dark 50 set background=dark
51 colorscheme peaksea2 51 colorscheme peaksea2
52 " colorscheme Dark 52 " colorscheme Dark
53 53
63 63
64 " setlocal spell spelllang=en_us 64 " setlocal spell spelllang=en_us
65 65
66 let mapleader="," 66 let mapleader=","
67 67
68 " ,/ will clear any highlighted search results
69 nmap <silent> ,/ :let @/=""<CR>
70
71 " NERD tree plugin 68 " NERD tree plugin
72 " nmap ,n :NERDTreeToggle<CR> 69 " nmap ,n :NERDTreeToggle<CR>
73 " let g:NERDTreeQuitOnOpen=1 70 " let g:NERDTreeQuitOnOpen=1
74 71
72 " ctags support
73
74 function BgnCtags()
75 let d = fnamemodify(findfile("root.dir", ";"), ":p:h")
76 let tags = d . "\\tags"
77 let s = "ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --exclude=Coe_prune --exclude=Opnet --languages=-all --languages=+c,c++,python -f " . tags . " " . d
78 echo s
79 call system(s)
80 endfunction
81
82 nnoremap <F8> :call BgnCtags()<CR>
83 nnoremap <F9> :tn<CR>
84 nnoremap <F10> :tp<CR>
85 nnoremap <F11> :tj<CR>
86 set tags=tags;/
87
88 " Trial settings
89 set wildmenu
90 set wildmode=list:longest
91 set laststatus=2
92 set gdefault
93 set showmatch
94 set formatoptions=qrn1
95 nnoremap ,/ :noh<CR>
96 " nnoremap / /\v
97 " vnoremap / /\v
98
99 " Splitting windows and moving around between them:
100 nnoremap ,v <C-w>v<C-w>l
101 nnoremap <C-h> <C-w>h
102 nnoremap <C-j> <C-w>j
103 nnoremap <C-k> <C-w>k
104 nnoremap <C-l> <C-w>l
105
106 " Absolute vs relative line numbers:
107 nnoremap ,na :set norelativenumber<CR>:set number<CR>
108 nnoremap ,nr :set relativenumber<CR>
109
110 " Format paragraph
111 nnoremap ,p gqip
112
75 " Pathogen support 113 " Pathogen support
76 call pathogen#infect() 114 call pathogen#infect()