From dd4c402d09ac15f33d875c02edcd9cae39f870e2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 1 Mar 2023 19:19:07 +0100 Subject: vim: group settings, add separators --- %HOME%/.vimrc | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to '%HOME%') diff --git a/%HOME%/.vimrc b/%HOME%/.vimrc index 59f0def..3dfd96c 100644 --- a/%HOME%/.vimrc +++ b/%HOME%/.vimrc @@ -1,5 +1,9 @@ source $VIMRUNTIME/vimrc_example.vim +" ----------------------------------------------------------------------------- +" File display +" ----------------------------------------------------------------------------- + filetype plugin on syntax enable @@ -9,6 +13,10 @@ colorscheme solarized set nowrap " Don't wrap lines. +" ----------------------------------------------------------------------------- +" Indentation +" ----------------------------------------------------------------------------- + " 4 spaces per indentation level, no tabs. set softtabstop=4 set shiftwidth=4 @@ -19,8 +27,24 @@ filetype indent on " C++'s public/private/protected keywords don't increase indentation level. set cinoptions+=g0 +" ----------------------------------------------------------------------------- +" User interface +" ----------------------------------------------------------------------------- + +" Highlight current line/column. +set cursorline +"set cursorcolumn +" Show current line/column number in the status bar. +set ruler +" Show line numbers on the left. +set number +" Add a vertical ruler. set colorcolumn=80 +" ----------------------------------------------------------------------------- +" Key bindings +" ----------------------------------------------------------------------------- + " In insert mode, press F2 to enter 'paste mode'. " Now you can paste text from elsewhere and _not_ mess up indentation. " Nice and easy, right? @@ -29,6 +53,14 @@ nnoremap :set invpaste paste? set pastetoggle= set showmode +" Insert newline without entering insert mode. +nmap O +nmap o + +" ----------------------------------------------------------------------------- +" System settings +" ----------------------------------------------------------------------------- + " Backup files are written to ~/.vimtmp/backup/. " I'm not sure how the whole thing's gonna work out in case of concurrent " writes to multiple files with the same name, since backup file names will @@ -59,21 +91,18 @@ endif set exrc set secure -" Search settings. +" ----------------------------------------------------------------------------- +" Search +" ----------------------------------------------------------------------------- + set ignorecase set smartcase set hlsearch set incsearch -" Line numbers & identification. -set cursorline -"set cursorcolumn -set number -set ruler - -" Insert newline without entering insert mode. -nmap O -nmap o +" ----------------------------------------------------------------------------- +" Directories +" ----------------------------------------------------------------------------- " Disable opening directories, netrw is too confusing. " https://unix.stackexchange.com/q/297844 @@ -86,5 +115,9 @@ endfor let loaded_netrwPlugin=1 +" ----------------------------------------------------------------------------- +" Clipboard +" ----------------------------------------------------------------------------- + " Access X clipboard. set clipboard=unnamedplus -- cgit v1.2.3