This repository has been archived on 2025-05-28. You can view files and clone it, but cannot push or open issues or pull requests.
config/.vimrc
2022-03-26 22:10:37 +01:00

126 lines
2.3 KiB
VimL

" DISPLAY SETTINGS:
" Display line numbers
set number
"colorscheme desert
colorscheme slate
" Show the 80th column (recent VIM)
set colorcolumn=80
" Enable complete folding of windows
set winminheight=0
" Split options
set splitbelow
set splitright
" How to display invisible characters
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
noremap <F2> :set list!<CR>
" Scroll by x cols when wrapping enabled
set sidescroll=1
" Allways keep x cols around the cursor
set sidescrolloff=3
" Toggle wrap mode
noremap <F5> :set wrap!<CR>
" SEARCH SETTINGS:
set ignorecase
" Highlight search results
set hlsearch
" Search while typing
set incsearch
" Press F3 to toggle highlighting on/off, and show current value.
":noremap <F3> :set hlsearch! hlsearch?<CR>
noremap <F3> :nohlsearch<CR>
" EDITION SETTINGS:
" Insert space for tab
set expandtab
" One tab is x spaces
set tabstop=4
" Indentation is x spaces
set autoindent
set shiftwidth=4
" No automatic return carriage
set textwidth=0
" Allow for edition everywhere
"set virtualedit=all
noremap <F4> :set virtualedit=all<CR>
noremap <S-F4> :set virtualedit=""<CR>
" FROM INTERNET SETTINGS:
" enter the current millenium
set nocompatible
" enable syntax and plugins (for netrw)
syntax enable
filetype plugin on
" FINDING FILES:
" Search down into subfolders
" Provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
set wildmenu
" NOW WE CAN:
" - Hit tab to :find by partial match
" - Use * to make it fuzzy
" THINGS TO CONSIDER:
" - :b lets you autocomplete any open buffer
" FILE BROWSING:
" Tweaks for browsing
let g:netrw_banner=0 " disable annoying banner
"let g:netrw_browse_split=4 " open in prior window
let g:netrw_altv=1 " open splits to the right
let g:netrw_liststyle=3 " tree view
"let g:netrw_list_hide=netrw_gitignore#Hide()
"let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
" NOW WE CAN:
" - :edit a folder to open a file browser
" - <CR>/v/t to open in an h-split/v-split/tab
" - check |netrw-browse-maps| for more mappings
" SNIPPETS:
" Read an empty HTML template and move cursor to title
nnoremap ,html :-1read $HOME/.vim/.skeleton.html<CR>3jwf>a
" NOW WE CAN:
" - Take over the world!
" (with much fewer keystrokes)