No .vimrc anymore, everything in /vim/.vim/plugin/
This commit is contained in:
23
vim/.vim/plugin/basics.vim
Normal file
23
vim/.vim/plugin/basics.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
" Basics
|
||||
syntax on
|
||||
filetype indent plugin on
|
||||
set background=light
|
||||
set encoding=utf-8
|
||||
set autowrite
|
||||
set smartcase
|
||||
set incsearch
|
||||
set hlsearch
|
||||
set nospell
|
||||
|
||||
" Tab behavior
|
||||
set expandtab
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
|
||||
"" New window positions
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" Statusbar
|
||||
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
|
||||
26
vim/.vim/plugin/functions.vim
Normal file
26
vim/.vim/plugin/functions.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" This callback will be executed when the entire command is completed
|
||||
function! BackgroundCommandClose(channel)
|
||||
" Read the output from the command into the quickfix window
|
||||
unlet g:backgroundCommandOutput
|
||||
endfunction
|
||||
|
||||
function! RunBackgroundCommand(command)
|
||||
" Make sure we're running VIM version 8 or higher.
|
||||
if v:version < 800
|
||||
echoerr 'RunBackgroundCommand requires VIM version 8 or higher'
|
||||
return
|
||||
endif
|
||||
if exists('g:backgroundCommandOutput')
|
||||
echo 'Already running task in background'
|
||||
else
|
||||
echo 'Running task in background'
|
||||
" Launch the job.
|
||||
" Notice that we're only capturing out, and not err here. This is because, for some reason, the callback
|
||||
" will not actually get hit if we write err out to the same file. Not sure if I'm doing this wrong or?
|
||||
let g:backgroundCommandOutput = tempname()
|
||||
call job_start(a:command, {'close_cb': 'BackgroundCommandClose', 'out_io': 'file', 'out_name': g:backgroundCommandOutput})
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" So we can use :BackgroundCommand to call our function.
|
||||
command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand(<q-args>)
|
||||
24
vim/.vim/plugin/remaps.vim
Normal file
24
vim/.vim/plugin/remaps.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
" Remaps
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
nnoremap J :bn<CR>
|
||||
nnoremap K :bp<CR>
|
||||
nnoremap u :earlier<CR>
|
||||
nnoremap U :later<CR>
|
||||
noremap <leader>y "+y
|
||||
noremap <C-E> :tabedit<Space>
|
||||
noremap <F1> :ter<CR>
|
||||
nmap 0 ^
|
||||
|
||||
" Diaeresis for e.g. german
|
||||
inoremap a" ä
|
||||
inoremap o" ö
|
||||
inoremap u" ü
|
||||
inoremap A" Ä
|
||||
inoremap U" Ü
|
||||
inoremap O" Ö
|
||||
inoremap jj <Esc>
|
||||
inoremap ;s ß
|
||||
inoremap ;e €
|
||||
14
vim/.vim/plugin/settings.vim
Normal file
14
vim/.vim/plugin/settings.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim Settings
|
||||
"" Move the swap file location to protect against CVE-2017-1000382
|
||||
if exists('$XDG_CACHE_HOME')
|
||||
let &g:directory=$XDG_CACHE_HOME
|
||||
else
|
||||
let &g:directory=$HOME . '/.cache'
|
||||
endif
|
||||
let &g:directory.='/vim/swap//'
|
||||
"" Create swap directory if it doesn't exist
|
||||
if ! isdirectory(expand(&g:directory))
|
||||
silent! call mkdir(expand(&g:directory), 'p', 0700)
|
||||
endif
|
||||
|
||||
|
||||
2
vim/.vim/plugin/skeletons.vim
Normal file
2
vim/.vim/plugin/skeletons.vim
Normal file
@@ -0,0 +1,2 @@
|
||||
nnoremap <leader>ctf :-read $HOME/.vim/skeleton/writeup.md<CR>A
|
||||
|
||||
Reference in New Issue
Block a user