Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "======================================================================
- "
- " init.vim -
- "
- " Created by me on 2023/07/06
- " Last Modified: 2020/07/06 16:59:26
- "
- "======================================================================
- " -----> Table of Contents <------
- " => SETTINGS
- " => USEFUL MAPPINGS
- " => terminal
- " => PLUGIN SETTINGS
- " => vim-plug
- " => choosewin
- " => syntastic
- " => airline
- " => devicons
- " => startify
- " => quickmenu
- " => easymotion
- " => easyalign
- " => indentline
- " => fzf & ripgrep
- " => suckless & termopen
- " => AUTOCOMMANDS
- " --------------------------------
- "===========================================================
- " => SETTINGS
- "===========================================================
- set termguicolors " enable true colors in your terminal
- set mouse="" " disables mouse support (so I can copy/paste like normal)
- set hlsearch " switch highlighting on for searched patterns
- set path+=** " enables fuzzy find, so you can recursively search for files via: find someFile ; type: set path? in insert mode to see what paths it searches through
- set complete=.,w,b,u,t,i,kspell " modifies ^p to look for matches in: current buffer / windows / other buffers / unloaded buffers / tags file / included files / dictionary (when 'set spell' is enabled)
- set ignorecase " case insensitive searching
- set smartcase " case-sensitive if case expression contains contains a capital letter
- set scrolloff=8 " how many lines before or after the cursor, for the screen to scroll up/down
- set hidden " current buffer can be put into the background so that you can modify a file and move to another without having to write to it then and there
- set showmatch " when a bracket is inserted briefly jump to it's matching one, to show you its location
- set noshowmode " dont show which mode i'm in (since airline already does it)
- set relativenumber " turn on line numbers (relative line numbers)
- set numberwidth=3 " don't use an annoyingly wide number column (he value given is a minimum width to use for the number column, not a fixed size)
- set title " set terminal tital
- set nowrap " prevent long lines from breaking into multiple lines (see how use a symbol to denote would-be line breaks)
- set textwidth=150 " width of text rows (I set to 150 which is the max before it reaches the undotree side window)
- set undofile " maintain undo history between sessions
- set undodir=~/.config/nvim/undodir " store all the undo history files in that directory
- set backup " enable backups
- set backupdir=/run/media/manjaro/nan0/.vim_back,~/Documents " specify where backups will be stored
- set thesaurus=~/.config/nvim/thesaurus/mthesaur.txt " Specify a thesaurus to use (you use thesaurus via ^x+^t)
- set matchpairs+=<:> " Highlight matching pairs of brackets. Use the '%' character to jump between them.
- set noet ci pi
- "===========================================================
- " => USEFUL MAPPINGS
- "===========================================================
- let mapleader = "-" " another good leader key is <Space> or the the Windows key
- let maplocalleader = ""
- " Press F2 in normal mode to toggle set spell
- nnoremap <F2> :set spell!<CR>
- " Type jk to copy a paragraph and paste a copy of it just below. This is great when you're about to create a block of code that
- " will be similar, but not different enough to abstract (e.g. it blocks in rspec).
- nnoremap jj yap<S-}>p
- " Some new mappings that are more enhanced versions of commands like ci), di), yi)... The first one allows you to type cin(, yin(,
- " din(, etc and that will perform the same functions as ci), di), etc, BUT without needing to place your cursor in the parenthesis,
- " but rather you can be on any word in front of the parenthesis.. The second mapping does the samething but backwords (i.e. if the
- " parens if before your cursor). And the rest do the same thing but for different enclosing characters.
- onoremap in) :<c-u>normal! f(vi(<cr>
- onoremap il) :<c-u>normal! F)vi(<cr>
- onoremap in' :<c-u>normal! f'vi'<cr>
- onoremap il' :<c-u>normal! F'vi'<cr>
- onoremap in" :<c-u>normal! f"vi"<cr>
- onoremap il" :<c-u>normal! F"vi"<cr>
- onoremap in} :<c-u>normal! f{vi}<cr>
- onoremap il} :<c-u>normal! F}vi}<cr>
- onoremap in] :<c-u>normal! f[vi]<cr>
- onoremap il] :<c-u>normal! F]vi]<cr>
- onoremap in` :<c-u>normal! f`vi`<cr>
- onoremap il` :<c-u>normal! F`vi`<cr>
- onoremap in> :<c-u>normal! f<vi><cr>
- onoremap il> :<c-u>normal! F>vi><cr>
- " Use space+a to align a block of code as defined by your tw,ts, etc
- nnoremap <Space>a =ip
- " A slight improvement to <ESC> in that when you use it to go back into normal mode your cursor will no longer move a space to the left.
- inoremap <ESC> <ESC>`^
- " Use F6 to append date/time in a file
- nnoremap <F6> a<C-R>=strftime("%c")<CR><Esc>
- " Simply type 'q' in normal mode to quit out of windows, alt+q to close all windows, and alt+= to close a tab
- map q :q<CR>
- nnoremap <A-q> :qa<CR>
- " Remap the text justifier command 'gq' to just 'Q'
- map Q gq
- " Hover over a word and use ]c to correct the spelling (remember you can use ]s and [s to navigate to mispelled words)
- nnoremap [c z=1<CR><CR>
- " Chdir to that of the current file
- command! -bar Cd exec "chdir" expand("%:p:h")
- " Automatically puts the current word in %s/currentWord//g, and places you in the // to quickly search and replace text.
- nnoremap s :%s/<C-r><C-w>//g<Left><Left>
- " Window short-cuts
- nnoremap <silent> sp :split<CR>
- nnoremap <silent> ss :new<CR>
- nnoremap <silent> <A-w> :tabnew<CR>
- nnoremap <silent> so :only<CR>
- " Type vd to see the difference between the current buffer and the file it was loaded from, sd to to turn diffoff, ,s to save the changes, and ,q
- " to write quit out of the file
- nnoremap <silent> vd :vert new<CR>:set bt=nofile<CR>:r #<CR>:0d_<CR>:diffthis<CR>:wincmd l<CR>:diffthis<CR>
- nnoremap <silent> sd :winc p<CR>:set nodiff<CR>:bdelete%<CR>:diffoff<CR>
- nnoremap <silent> ,s :w<CR>:winc h<CR>:set nodiff<CR>:bdelete%<CR>:diffoff<CR>
- nnoremap <silent> ,a :w<CR>:winc h<CR>:set nodiff<CR>:bdelete%<CR>:diffoff<CR>:q<CR>
- " h,j,k, and l are considered moves not jumps so they are not added to the jumplist.. This mapping adds stores j/k moves
- " to the jumplist.. So not you can do 18j and then ^o to jump back..
- nnoremap <expr> k (v:count > 5 ? "m'" . v:count : '') . 'k'
- nnoremap <expr> j (v:count > 5 ? "m'" . v:count : '') . 'j'
- " Use Alt+left or Alt+right to move between buffers
- nnoremap <A-right> <CR>:bnext<CR>
- nnoremap <A-left> <CR>:bprevious<CR>
- " Use F3 to toggle a vertical cursorcolumn that you can use to visually see if you're code is going
- " past your textwidth limit
- nnoremap <expr> <F3> ToggleColorColumn()
- func ToggleColorColumn()
- if strlen(&cc)
- set cc=
- else
- set cc=79
- endif
- endfunc
- "==============================================================================
- " => Terminal
- "==============================================================================
- tnoremap <Esc> <C-\><C-n> " allows me to use <Esc> instead of ^\^n in terminals to get back into normal mode
- map <silent> <A-e> :tabnew<CR><S-:>:terminal bash --rcfile ~/.bash_it/.bashrc<CR>
- " Switch to insert mode when focusing on terminal window
- autocmd BufWinEnter,WinEnter * if &buftype == 'terminal' | silent! normal i | endif
- "==============================================================================
- " => Folds
- "==============================================================================
- " Map the <Space> key to toggle a selected fold opened/closed.
- nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
- vnoremap <Space> zf
- " Automatically save and load folds
- """autocmd BufWinLeave *.* mkview
- autocmd BufWinEnter *.* silent loadview"
- "===========================================================
- " => PLUGIN SETTINGS
- "===========================================================
- "==============================================================================
- " => Vim-plug
- "==============================================================================
- command! PU PlugUpdate | PlugUpgrade " type :PU to both update and upgrade vimplug
- " Auto-install vim-plug
- if empty(glob('~/.config/nvim/autoload/plug.vim'))
- echo '==> Installing vim-plug...'
- silent !torsocks curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
- \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
- endif
- " Auto-install pip
- if empty(glob('~/.local/bin/pip'))
- echo '==> Installing pip...'
- silent !torsocks curl https://bootstrap.pypa.io/get-pip.py -o ~/get-pip.py " Download pip from github
- silent !torsocks python ~/get-pip.py --user && rm ~/get-pip.py " Install pip which also installs setuptools and wheel
- " silent !torsocks ~/.local/bin/pip install virtualenv --user " Install virualenv
- " silent !~/.local/bin/virtualenv ~/.python " Initialize a python virtual environment
- " silent !source ~/.python/bin/activate " Change to the virtual environment
- endif
- " Auto-install ranger file manager
- if empty(glob('~/.ranger'))
- echo '==> Installing ranger...'
- silent !git clone --depth=1 https://github.com/ranger/ranger.git ~/.ranger
- endif
- " Auto-install powerline font
- if empty(glob('~/.local/share/fonts/PowerlineSymbols.otf'))
- echo '==> Installing powerline-font...'
- silent !torsocks curl -fLo ~/.local/share/fonts/PowerlineSymbols.otf --create-dirs https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
- silent !torsocks curl -fLo ~/.config/fontconfig/conf.d/10-powerline-symbols.conf --create-dirs https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
- silent !torsocks curl -fLo ~/.local/share/fonts/DroidSansMonoNerdFontComplete.otf https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf
- silent !fc-cache -fv ~/.local/share/fonts
- endif
- " Auto-install bash-it
- if empty(glob('~/.bash_it'))
- echo '==> Installing bash-it...'
- silent !git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
- silent !~/.bash_it/install.sh --silent
- silent !mv ~/.bashrc ~/.bash_it && mv ~/.bashrc.bak ~/.bashrc
- silent !sed -i 's/bobby/powerline/' ~/.bash_it/.bashrc
- endif
- " Auto-install en.ascii.spl
- if empty(glob('~/.config/nvim/spell'))
- echo '==> Installing en.ascii.spl...'
- silent !torsocks curl -fLo ~/.config/nvim/spell/en.ascii.spl --create-dirs 'http://ftp.vim.org/pub/vim/runtime/spell/en.ascii.spl'
- endif
- " Specify a directory for plugins
- call plug#begin('~/.config/nvim/plugged')
- " Have vim-sensible load first (sensible vim settings everyone can agree on; should not remove). Also I modify is to C-l is changed to
- " C-n (to clear highlighting of searches) cause I have C-l mapped already to resizing windows.
- Plug 'https://github.com/tpope/vim-sensible.git', { 'do': 'sed -i \"34,35s/C-L/C-n/g\" ./plugin/sensible.vim' }
- call plug#load('vim-sensible')
- "Visuals:
- Plug 'https://github.com/mhinz/vim-startify.git'
- Plug 'https://github.com/vim-airline/vim-airline.git'
- Plug 'https://github.com/vim-airline/vim-airline-themes.git'
- Plug 'https://github.com/ryanoasis/vim-devicons.git'
- "Color Schemes:
- Plug 'https://github.com/rj-white/vim-colors-paramountblue.git'
- Plug 'https://github.com/morhetz/gruvbox.git'
- "Aesthetics:
- Plug 'https://github.com/andymass/vim-matchup.git'
- Plug 'https://github.com/Yggdroot/indentLine.git'
- Plug 'https://github.com/sheerun/vim-polyglot.git'
- "Performance:
- Plug 'https://github.com/t9md/vim-choosewin.git'
- Plug 'https://github.com/roxma/vim-window-resize-easy.git'
- Plug 'https://github.com/fabi1cazenave/suckless.vim.git'
- Plug 'https://github.com/fabi1cazenave/termopen.vim.git', { 'do': 'sed -i \"55s/signcolumn=no //\" ./plugin/termopen.vim' }
- Plug 'https://github.com/tpope/vim-commentary.git'
- Plug 'https://github.com/junegunn/vim-easy-align.git'
- Plug 'https://github.com/easymotion/vim-easymotion.git'
- Plug 'https://github.com/tpope/vim-repeat.git'
- Plug 'https://github.com/junegunn/fzf.git', { 'dir': '~/.fzf', 'do': './install --all' } | Plug 'https://github.com/junegunn/fzf.vim.git'
- Plug 'https://github.com/tpope/vim-surround.git'
- Plug 'https://github.com/Raimondi/delimitMate.git'
- Plug 'https://github.com/wsdjeg/FlyGrep.vim.git'
- "Utilities:
- Plug 'https://github.com/thoughtbot/vim-rspec.git'
- Plug 'https://github.com/vim-syntastic/syntastic.git'
- Plug 'https://github.com/tpope/vim-fugitive.git'
- "Plug 'https://github.com/lambdalisue/suda.vim.git'
- "Plug 'https://github.com/vim-scripts/sudo.vim.git'
- Plug 'https://github.com/christoomey/vim-system-copy.git'
- Plug 'https://github.com/szw/vim-dict.git'
- Plug 'https://github.com/beloglazov/vim-online-thesaurus.git'
- "Snippets:
- Plug 'https://github.com/honza/vim-snippets.git'
- Plug 'https://github.com/Shougo/neosnippet-snippets.git'
- Plug 'https://github.com/Shougo/neosnippet.vim.git'
- " Initialize plugin system
- call plug#end()
- " A vim-plug function that checks if a plugin is loaded or not
- function! PlugLoaded(name)
- return (
- \ has_key(g:plugs, a:name) &&
- \ isdirectory(g:plugs[a:name].dir) &&
- \ stridx(&rtp, g:plugs[a:name].dir) >= 0)
- endfunction
- if PlugLoaded('gruvbox')
- colorscheme gruvbox
- endif
- set background=dark " some colorschemes (like gruvbox) use this setting to determine what colors to use
- hi clear SpellBad
- hi SpellBad guifg=#EBDBB2 guibg=#FB4934 gui=none
- "==============================================================================
- " => Choosewin
- "==============================================================================
- " Use '-' to bring up the choosewin prompt
- nmap - <Plug>(choosewin)
- "==============================================================================
- " => Syntastic
- "==============================================================================
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 1
- let g:syntastic_check_on_open = 0
- let g:syntastic_check_on_wq = 1
- "==============================================================================
- " => Airline
- "==============================================================================
- let g:airline_theme='gruvbox'
- "set statusline=%!getcwd() " always show the CWD in the status line
- let g:airline_powerline_fonts = 1
- let g:airline_section_b = '%{getcwd()}' " In Section B of the status line display the CWD
- "Tabline:
- let g:airline#extensions#tabline#enabled = 1 " enable airline tabline
- let g:airline#extensions#tabline#tab_nr_type= 1 " configure how numbers are displayed in tab mode from 0-2 (1 is just tab number)
- let g:airline#extensions#tabline#tabs_label = '' " can put text here like BUFFERS to denote buffers (I clear it so nothing is shown)
- let g:airline#extensions#tabline#buffers_label = '' " can put text here like TABS to denote tabs (I clear it so nothing is shown)
- let g:airline#extensions#tabline#fnamemod = ':t' " disable file paths in the tab
- let g:airline#extensions#tabline#show_buffers = 0 " dont show buffers in the tabline
- "==============================================================================
- " => Devicons
- "==============================================================================
- let g:WebDevIconsUnicodeDecorateFolderNodes = 1
- "==============================================================================
- " => Startify
- "==============================================================================
- let g:startify_session_dir = '~/.config/nvim/session' " the directory to save/load sessions to/from
- let g:startify_files_number = 4
- let g:startify_update_oldfiles = 1 " updates the 'recently used files' while in the same vim session.
- let g:startify_session_persistence = 1
- let g:startify_change_to_dir = 1
- let g:startify_custom_header = [
- \ '',
- \ '',
- \ ' ##############..... ############## ',
- \ ' ##############......############## ',
- \ ' ##########..........########## ',
- \ ' ##########........########## ',
- \ ' ##########.......########## ',
- \ ' ##########.....##########.. ',
- \ ' ##########....##########..... ',
- \ ' ..##########..##########......... ',
- \ ' ....##########.#########............. ',
- \ ' ..################JJJ............ ',
- \ ' ################............. ',
- \ ' ##############.JJJ.JJJJJJJJJJ ',
- \ ' ############...JJ...JJ..JJ JJ ',
- \ ' ##########....JJ...JJ..JJ JJ ',
- \ ' ########......JJJ..JJJ JJJ JJJ ',
- \ ' ###### ......... ',
- \ ' ..... ',
- \ ' . ',
- \ '',
- \ '',
- \ ]
- let g:startify_lists = [
- \ { 'type': 'bookmarks', 'header': [' My bookmarks:'] },
- \ { 'type': 'dir', 'header': [' My most recently used files in the current directory:'] },
- \ { 'type': 'files', 'header': [' My most recently used files:'] },
- \ { 'type': 'sessions', 'header': [' Saved sessions:'] },
- \ ]
- let g:startify_bookmarks = [ '~/.config/nvim/init.vim' ]
- "==============================================================================
- " => Easymotion
- "==============================================================================
- let g:EasyMotion_smartcase = 1 " turn on case smart-insensitivity
- let g:EasyMotion_use_smartsign_us = 1 " turn on smart symbols matching
- let g:EasyMotion_do_mapping = 0 " disable default mappings (they slow vim down by having already used leaders waiting for other possible options)
- " Allow motioning over to words in other windows via w
- nmap f <Plug>(easymotion-overwin-w)
- " Replace the default search of Vim. Also you can use `<Tab>` and `<S-Tab>` to
- " scroll down/up a page. If you press `<CR>`, you get the usual EasyMotion
- " highlighting and can jump to any matching target destination with a single
- " keystroke. The `n` & `N` mappings are options. You do not have to map `n` &
- " `N` to EasyMotion. Without these mappings, `n` & `N` works fine. (These
- " mappings just provide different highlight method and have some other features )
- " The . mapping makes used of vim-repeat to allow you to repeat your last search
- map / <Plug>(easymotion-sn)
- omap / <Plug>(easymotion-tn)
- map ? <Plug>(easymotion-sn)
- omap ? <Plug>(easymotion-tn)
- map n <Plug>(easymotion-next)
- map N <Plug>(easymotion-prev)
- " Allows you to repeat the last search with / and ? using
- nmap <Space>s <Plug>(easymotion-repeat)
- "==============================================================================
- " => Easyalign
- "==============================================================================
- " Start interactive EasyAlign in visual mode (e.g. vipga)
- xmap ga <Plug>(EasyAlign)
- " Start interactive EasyAlign for a motion/text object (e.g. gaip)
- nmap ga <Plug>(EasyAlign)
- "==============================================================================
- " => IdentLine
- "==============================================================================
- let g:indentLine_char_list = ['¦']
- let g:indentLine_bufTypeExclude = ['help', 'terminal'] " specify a list of file types, when opening these types of files the plugin is disabled
- let g:indentLine_fileTypeExclude = ['text', ''] " specify a list of buffer types, when opening these types of buffers, the plugin is disabled
- let g:indentLine_bufNameExclude = ['*.txt', 'NERD_tree.*'] " specify names or regexs. If the buffer's name fall into this list, the plugin is disabled
- " The identline plugin only displays whitespace indents. The following display chars for other types.. I.e. '•' is whitespace on
- " blank lines, and '›' is tabs.
- set list lcs=tab:›\ ,trail:•,extends:#,nbsp:.
- "==============================================================================
- " => Fzf & Ripgrep
- "==============================================================================
- " Now you can do :grep searchtext and rg will search recursively through the current directory for files containing "searchtext". ripgrep is much faster than
- " standard grep, and has sensible defaults such as using your .gitignore file and only performing case-sensitive searches if you have a mixed case
- " search term.
- if executable('rg')
- let &grepprg = "rg --vimgrep"
- endif
- nmap <space>f :Files<cr>| " fuzzy find files in the working directory (where you launched Vim from)
- nmap <space>/ :BLines<cr>| " fuzzy find lines in the current file
- nmap <space>b :Buffers<cr>| " fuzzy find an open buffer
- nmap <space>r :Rg | " fuzzy find text in the working directory
- nmap <space>c :Commands<cr>| " fuzzy find Vim commands (like Ctrl-Shift-P in Sublime/Atom/VSC)
- "==============================================================================
- " => Suckless & Termopen
- "==============================================================================
- " i3 style mappings:
- let g:suckless_mappings = {
- \ '<M-[sdf]>' : 'SetTilingMode("[sdf]")' ,
- \ '<M-[hjkl]>' : 'SelectWindow("[hjkl]")' ,
- \ '<M-[HJKL]>' : 'MoveWindow("[hjkl]")' ,
- \ '<C-M-[hjkl]>' : 'ResizeWindow("[hjkl]")' ,
- \ '<M-[oO]>' : 'CreateWindow("[sv]")' ,
- \ '<M-[123456789]>' : 'SelectTab([123456789])',
- \ '<M-[!@#$%^&*(]>' : 'MoveWindowToTab([123456789])',
- \ '<C-M-[123456789]>' : 'CopyWindowToTab([123456789])',
- \}
- " To be more consistent with most tiling window managers (wmii, i3, awesome…) the following two settings are recommended:
- set splitbelow
- set splitright
- let g:suckless_tmap = 1 " all Alt-* shortcuts can be used on terminal windows in insert mode if this is set
- nmap <silent> <M-Return> :call TermOpen('bash --rcfile ~/.bash_it/.bashrc')<CR><C-\><C-n>
- nmap <silent> <M-Backspace> :call TermOpen('~/.ranger/ranger.py')<CR>
- "My Custom Mappings:
- " These are mappings I made to automatically open terminals (up to 6) in a newtab in a stacked format
- map <A-t>6 :tabnew<CR><A-CR><A-CR><A-CR><A-CR><A-CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k>
- map <A-t>5 :tabnew<CR><A-CR><A-CR><A-CR><A-CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k>
- map <A-t>4 :tabnew<CR><A-CR><A-CR><A-CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k>
- map <A-t>3 :tabnew<CR><A-CR><A-CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k>
- map <A-t>2 :tabnew<CR><A-CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k>
- " Note: https://github.com/neovim/neovim/issues/5541 (planned enhancements to openining terminal in a new tab by default)
- " When this those enchanments happen the terminals will open as smoothly as the following stacked buffers do.
- " map <A-t>2 :terminal<CR><ESC><A-CR><A-s>
- " Same as the previous set of mappings except these open up stacked buffers in a new tab
- map <A-r>6 :tabnew<CR><A-o><A-o><A-o><A-o><A-o><A-s>
- map <A-r>5 :tabnew<CR><A-o><A-o><A-o><A-o><A-s>
- map <A-r>4 :tabnew<CR><A-o><A-o><A-o><A-s>
- map <A-r>3 :tabnew<CR><A-o><A-o><A-s>
- map <A-r>2 :tabnew<CR><A-o><A-s>
- " Use alt+u to open up 1 stacked terminal and 1 stacked buffer
- map <A-u> :tabnew<CR><A-CR><A-s><A-j><ESC>:bd!<CR><A-k><A-o>
- " Use alt+p open up a new stacked terminal, and and alt+P to open a new vertical terminal
- map <A-p> <A-CR><A-s>
- map <A-P> <S-A-o>:terminal bash --rcfile ~/.bash_it/.bashrc<CR>
- " This plugin modifies the tab labels to show: the tab number between brackets, with a * sign if a buffer in this tab is modified;
- " the current buffer name, with a trailing + sign if modified. To leave tabs unchanged use:
- let g:suckless_guitablabel = 0
- "===========================================================
- " => AUTOCOMMANDS
- "===========================================================
- if has('autocmd') && !exists('autocommands_loaded')
- let autocommands_loaded = 1
- " Put these in an autocmd group, so that we can delete them easily
- augroup vimrcEx
- au!
- " File type specific settings for tabstop, softtabstop, shiftwidth, and textwidth values... 'sw' is for how many spaces to move when you hit tab, 'ts'
- " automatically idents expressions (not control structures!) of the file you open to your liking 'sts' is pretty much the same thing as 'sw' except it
- " uses a combination of spaces+tabs which is dumb. E.g. if you're ts is set to 8 and you have a sts of 4 then it'll use a 4 length tab + four spaces.. I
- " dont see any point in this so just keep it's value equal to ts to ensure to always use tabs.. In either case your sts and sw should always be the same
- " value. Also note sts work with the expandtab setting, as if that's set then th
- autocmd Filetype vim,css setlocal ts=2 sts=2 sw=2
- autocmd Filetype yaml setlocal ts=3 sts=3 sw=3 tw=80
- autocmd Filetype sh,bash,pl,py setlocal ts=8 sts=8 sw=8
- " Append a time/date to backups
- au BufWritePre * let &bex = '-' . strftime("%Y-%b%d-%X") . '~'
- " When editing a file, always jump to the last known cursor position
- autocmd BufReadPost *
- \ if line("'\"") >= 1 && line("'\"") <= line("$") |
- \ exe "normal! g`\"" |
- \ endif
- " Allows transparent background to work with various color schemes (note, you're using your terminal's color palette, and not your color scheme's)
- "autocmd VimEnter * hi Normal guibg=none
- augroup END
- endif
- " vim:set ft=vim et sw=2:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement