General Settings

< Previous | Next >
let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum"

Sets colors up in case they aren't working with what you're doing and doesn't break anything if they are working. Mine breaks under certain use cases like editing remote files or certain shells I try out.


Tabs, Indents, and the Like

set expandtab set smarttab set shiftwidth=2 set softtabstop=2 set tabstop=2

2 width tab gang


set cindent set autoindent set smartindent

Pretty sure smartindent is redundant here with cindent, but this is just quality of life indentation, cindent uses context to see where you want to indent and uses C style guides, autoindent just keeps you at the same level of indentation unless it clearly shouldn't.


set wrap

Sometimes linebreaks aren't optimal.


set autoread

Has vim auto update a file if it is changed outside of vim, so you see what the current version is.


set number relativenumber set ruler set cursorline

I wanna know where I am, relative number superiority


set ignorecase set smartcase set hlsearch set incsearch

Search settings, ignorecase+smartcase means capitilization doesn't matter unless the first letter is capitalized


set lazyredraw

Only draw to the screen when it has to, no reason not to have this


set mat=2

How many tenths of a second to wait between blinks on matching brackets. Not sure why this settings exists or why i set it.


set noshowmode

I use airline, I don't need to be told my mode elsewhere.


set cmdheight=1

Is there a reason to have this higher than 1? Sets the height of the command mode bar to 1 unit.


set clipboard=unnamedplus

Use the system clipboard for the default register


set undofile

Persistent undos between sessions, bloat but worth it.


set exrc set secure

Would probably not recommend this, it executes the vimrc file present in whatever directory you run vim in, but

set secure
stops it from running as many options, but handy if you want certain options for certain projects.


set foldmethod manual

Make your folds by hand like a true king.


set wildmode=longest,list,full

Makes tab complete for commands even better, 100% recommend.


let NERDTreeShowHidden=1

NERDTree option, I edit hidden files sometimes, a must have.


let g:CoolTotalMatches=1

Vim Cool option, show how many matches there were in the file.


Autocommands

au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

All this to restore cursor position when I open a file? Really? If I'm doing it wrong please shoot me an email and correct me.


autocmd BufWritePre * %s/\s\+$//e

Removing trailing whitespace, very handy, why wouldn't you want this?


augroup remember_folds autocmd! autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent! loadview augroup END

Folds are the best thing in the world, this maintains them automatically on opening a file. Sometimes gives error messages on certain actions but its negligible in my eyes. If you have a better way let me know, I'll throw it in here.


autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions -=o

I don't know how else to implement no auto commenting on new lines, this is the only way I could make work.


au TextYankPost * silent! lua vim.highlight.on_yank()

I want my text to highlight briefly when I yank it so I can see what I did


autocmd FileType * RainbowParentheses autocmd BufWinEnter *.wiki RainbowParentheses! autocmd BufWinLeave *.wiki RainbowParentheses

RainbowParentheses auto starting, it breaks wiki formatting so we disable it for those and autostart it when we leave them.


< Previous | Next >
Main Page