General Improvements

This commit is contained in:
Talia 2018-02-09 08:31:25 +01:00
parent 2505b7abef
commit 434be3251f
1 changed files with 22 additions and 5 deletions

27
vimrc
View File

@ -1,5 +1,8 @@
"!!! makes use of marker ' "!!! makes use of marker '
set nocompatible
""""""""""""""""
" Sessions " Sessions
set sessionoptions=blank,buffers,curdir,folds,help,options,tabpages set sessionoptions=blank,buffers,curdir,folds,help,options,tabpages
@ -19,8 +22,6 @@ elseif v:version >= 703
set cm=blowfish set cm=blowfish
end end
set nocompatible
""""""""""""""""
" set linespace=0 " set linespace=0
set scrolloff=6 set scrolloff=6
set history=50 " keep 50 lines of command line history set history=50 " keep 50 lines of command line history
@ -344,19 +345,31 @@ command! -nargs=? Scratch new | set buftype=nofile | set filetype=<args>
" === GENERAL KEY MAPPINGS === " === GENERAL KEY MAPPINGS ===
let mapleader = "\\" let mapleader = "\\"
let g:jmp_dist = 8
nmap <C-j> :exec "normal ".g:jmp_dist."j"<CR>
nmap <C-k> :exec "normal ".g:jmp_dist."k"<CR>
" Yes, not 'noremap', do whatever is mapped to J and K assuming
" it is some sort of custom up-down motion, but g:jmp_dist times
" --- /dev/null --- " --- /dev/null ---
noremap <leader>d "_d noremap <leader>d "_d
noremap <leader>d "_d noremap <leader>d "_d
noremap x "_x noremap x "_x
noremap <leader>x x noremap <leader>x x
" --- Numbvers --- " --- Numbers ---
nnoremap <leader>- <C-x> nnoremap <leader>- <C-x>
nnoremap <leader>= <C-a> nnoremap <leader>= <C-a>
" --- Text ---
nnoremap U ~h
" --- MOVEMENT --- " --- MOVEMENT ---
nnoremap j gj noremap j gj
nnoremap k gk noremap k gk
noremap gj j
noremap gk k
" --- CLIPBOARD --- " --- CLIPBOARD ---
nnoremap Y y$ nnoremap Y y$
@ -379,11 +392,13 @@ noremap Q @q
nnoremap <S-space> gQ nnoremap <S-space> gQ
" noremap <C-s> :w<CR> " noremap <C-s> :w<CR>
function! s:saveprompt() function! s:saveprompt()
let b:rightsave=1
if input("Type 'save' to save: ") ==? "save" if input("Type 'save' to save: ") ==? "save"
write write
else else
echo "Calm the fuck down man!" echo "Calm the fuck down man!"
end end
unlet b:rightsave
endfun endfun
noremap <C-s> :call <sid>saveprompt()<CR> noremap <C-s> :call <sid>saveprompt()<CR>
nnoremap <C-n> :bnext<CR> nnoremap <C-n> :bnext<CR>
@ -454,6 +469,8 @@ digraph ss 223
" === GENERAL AUTOCOMMANDS === " === GENERAL AUTOCOMMANDS ===
command! HLProgress syntax match Comment /\_.*\ze\n.*\%#/
nnoremap <leader>h :call <SID>toggleWUC()<CR> nnoremap <leader>h :call <SID>toggleWUC()<CR>
function! s:updateWUC() function! s:updateWUC()
if exists("b:hlwuc") if exists("b:hlwuc")