Skip to content

Instantly share code, notes, and snippets.

@ivandev-81
Last active November 18, 2024 08:53
Show Gist options
  • Save ivandev-81/2de328d83d3b4af4865d6b0484721101 to your computer and use it in GitHub Desktop.
Save ivandev-81/2de328d83d3b4af4865d6b0484721101 to your computer and use it in GitHub Desktop.
ivan ~/.config/nvim/init.vim
syntax on
set number
set t_Co=256
set selection=old
set encoding=utf-8
set updatetime=300
filetype indent on
set colorcolumn=79
colorscheme desert
set clipboard=unnamedplus
set backspace=indent,eol,start
"Ctrl-c to copy in + buffer from visual mode
vmap <C-c> "+y
"Ctrl-p to paste from the + register in cmd mode
map <C-v> "+p
" Ctrl+s to save in normal and insert mode
nmap <C-s> :w<CR>
imap <c-s> <Esc>:w<CR>a
" config from https://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces
set tabstop=4 " Size of a hard tabstop (ts).
set shiftwidth=4 " Size of an indentation (sw).
set expandtab " Always uses spaces instead of tab characters (et).
set softtabstop=4 " Number of spaces a <Tab> counts for. When 0, featuer is off (sts).
set autoindent " Copy indent from current line when starting a new line.
set smarttab " Inserts blanks on a <Tab> key (as per sw, ts and sts).
" enabling auto save
" source: https://vi.stackexchange.com/questions/74/is-it-possible-to-make-vim-auto-save-files
" autocmd TextChanged,TextChangedI <buffer> silent write
" bakups
set backup " make backup files
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
" make spaces visibles: https://stackoverflow.com/questions/1675689/make-vim-show-all-white-spaces-as-a-character
set list
set listchars=space:•
" xterm 256 colors fg: https://misc.flogisoft.com/_media/bash/colors_format/256_colors_fg.png
" ANSI/VT100 color control sequences reference: https://misc.flogisoft.com/bash/tip_colors_and_formatting
highlight NonText cterm=NONE ctermfg=240 ctermbg=NONE
highlight SpecialKey cterm=NONE ctermfg=240 ctermbg=NONE
" Powerline
" let g:powerline_pycmd="py3"
" set rtp+=/usr/share/powerline/bindings/vim
set laststatus=2
" Plug Installation:
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
" to install plugins declared in ~/.vimrc:
" :w
" :so %
" :PlugInstall
"
" Plug Extensions begins
call plug#begin('~/.vim/plugged')
Plug 'mattn/emmet-vim'
call plug#end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment