aboutsummaryrefslogtreecommitdiffstats
path: root/.vimrc
diff options
context:
space:
mode:
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc32
1 files changed, 23 insertions, 9 deletions
diff --git a/.vimrc b/.vimrc
index 0f247da..e6ef45f 100644
--- a/.vimrc
+++ b/.vimrc
@@ -2,19 +2,31 @@ syntax on
filetype plugin on
set autoindent
+"colours!
+colorscheme calmar256-dark
+set background=dark
+
"tab controls to match pentadactyl
map <C-n> <Esc>:tabn<CR>
map <C-p> <Esc>:tabp<CR>
map <C-t> <Esc>:tabnew<CR>
"insert lines above and below with (=|+)
-nnoremap = O<Esc>j
-nnoremap + O<Esc>
+"very hackish, but i couldn't think of a better way
+nnoremap = Oa<C-u><Esc>j
+nnoremap + oa<C-u><Esc>k
"disable auto session save/load
let g:session_autosave = 'no'
let g:session_autoload = 'no'
+"folds!
+map fo zO
+map fc zC
+map fm zM
+map fr zR
+
+
"copy words from above and below the cursor
inoremap <expr> <c-y> pumvisible() ? "\<c-y>" : matchstr(getline(line('.')-1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
inoremap <expr> <c-e> pumvisible() ? "\<c-e>" : matchstr(getline(line('.')+1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
@@ -37,22 +49,24 @@ if &term != "linux"
xnoremap <expr> P (v:register ==# '"' ? '"+' : '') . 'P'
end
-"filetype-specific settings. i can't figure out how to stick all the
-"FileTypes in one list (mostly because i have no idea what i'm doing
-"with viml), so separate lines it is.
+"annoying syntax-related values that need to be set before files are
+"opened
+let g:c_no_comment_fold = 1
+let g:c_no_if0_fold = 1
+
+"other filetype-specific settings. i can't figure out how to stick all
+"the FileTypes in one list (mostly because i have no idea what i'm
+"doing with viml), so separate lines it is.
autocmd FileType c call Settings_c()
autocmd FileType cpp call Settings_c()
autocmd FileType perl call Settings_perl()
function! Settings_c()
- "i want autoindent as the default, and doing that along with
- "filetype indent on yields wonky results
setlocal cindent
+ set foldmethod=syntax
endfunction
function! Settings_perl()
- "i want autoindent as the default, and doing that along with
- "filetype indent on yields wonky results
setlocal smartindent
endfunction