Tidy vimrc
This commit is contained in:
parent
7d1b14113b
commit
5252fc5cd3
37
home/.vimrc
37
home/.vimrc
@ -1,24 +1,18 @@
|
|||||||
" A few sane defaults for use in ArchLabs
|
" Sane vim defaults for ArchLabs
|
||||||
|
|
||||||
" load Arch Linux defaults
|
" Arch defaults
|
||||||
runtime! archlinux.vim
|
runtime! archlinux.vim
|
||||||
|
|
||||||
" system clipboard (requires +clipboard)
|
|
||||||
set clipboard^=unnamedplus
|
|
||||||
|
|
||||||
" enable line numbers
|
set modeline
|
||||||
set number
|
set clipboard^=unnamedplus " system clipboard (requires +clipboard)
|
||||||
|
set number " enable line numbers
|
||||||
" ask confirmation for some things, like save when quiting, etc.
|
set confirm " ask confirmation for some things, like save before quit, etc.
|
||||||
set confirm
|
set wildmenu " Tab completion menu when using command mode
|
||||||
|
set expandtab " Tab key inserts spaces not tabs
|
||||||
" Tab completion menu when using command mode
|
set softtabstop=4 " spaces to enter for each tab
|
||||||
set wildmenu
|
set shiftwidth=4 " amount of spaces for indentation
|
||||||
|
set shortmess+=aAcIws " Hide or shorten certain messages
|
||||||
set expandtab " Tab key inserts spaces not tabs
|
|
||||||
set softtabstop=4 " spaces to enter for each tab
|
|
||||||
set shiftwidth=4 " amount of spaces for indentation
|
|
||||||
set shortmess+=aAcIws " Hide or shorten certain messages
|
|
||||||
|
|
||||||
" enable mouse.. sgr is better but not every term supports it
|
" enable mouse.. sgr is better but not every term supports it
|
||||||
set mouse=a
|
set mouse=a
|
||||||
@ -35,26 +29,25 @@ endif
|
|||||||
" paste while in insert mode
|
" paste while in insert mode
|
||||||
inoremap <silent><C-v> <Esc>:set paste<CR>a<C-r>+<Esc>:set nopaste<CR>a
|
inoremap <silent><C-v> <Esc>:set paste<CR>a<C-r>+<Esc>:set nopaste<CR>a
|
||||||
|
|
||||||
" changed default mappings
|
" alt defaults
|
||||||
nnoremap 0 ^
|
nnoremap 0 ^
|
||||||
nnoremap Y y$
|
nnoremap Y y$
|
||||||
nnoremap n nzzzv
|
nnoremap n nzzzv
|
||||||
nnoremap N Nzzzv
|
nnoremap N Nzzzv
|
||||||
nnoremap <Tab> ==j
|
nnoremap <Tab> ==j
|
||||||
|
|
||||||
" gj/k but preserve numbered jumps ie. 12j or 30k
|
" j=gj k=gk but preserve numbered jumps ie. 12j or 30k
|
||||||
nnoremap <buffer><silent><expr>j v:count ? 'j' : 'gj'
|
nnoremap <buffer><silent><expr>j v:count ? 'j' : 'gj'
|
||||||
nnoremap <buffer><silent><expr>k v:count ? 'k' : 'gk'
|
nnoremap <buffer><silent><expr>k v:count ? 'k' : 'gk'
|
||||||
|
|
||||||
" Reload changes if file changed outside of vim
|
" Reload changes if file changed outside of vim requires autoread
|
||||||
" requires autoread (enabled by default)
|
|
||||||
augroup load_changed_file
|
augroup load_changed_file
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FocusGained,BufEnter * if mode() !=? 'c' | checktime | endif
|
autocmd FocusGained,BufEnter * if mode() !=? 'c' | checktime | endif
|
||||||
autocmd FileChangedShellPost * echo "Changes loaded from file"
|
autocmd FileChangedShellPost * echo "Changes loaded from file"
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" when quitting, save cursor position
|
" when quitting a file, save the cursor position
|
||||||
augroup save_cursor_position
|
augroup save_cursor_position
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufReadPost * call setpos(".", getpos("'\""))
|
autocmd BufReadPost * call setpos(".", getpos("'\""))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# this file is executed when calling startx
|
# this file is executed when calling startx
|
||||||
|
|
||||||
# To run different WM, run:
|
# To run a different WM, set session="WM" below, or run:
|
||||||
# startx ~/.xinitrc WM
|
# startx ~/.xinitrc WM
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user