Previous Page

nihilist - 00 / 00 / 00

custom vimrc

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

You can use DuckDNS to get a free domain name:


[ 192.168.100.1/24 ] [ /dev/pts/13 ] [~/Nextcloud/blog/Conf]
→ ssh root@ech4.duckdns.org
The authenticity of host 'ech4.duckdns.org (178.128.46.38)' can't be established.
ECDSA key fingerprint is SHA256:z2HAncB99pfbAUfj9tJY7vlo8EGUzCIUxWBAnjAflcA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ech4.duckdns.org,178.128.46.38' (ECDSA) to the list of known hosts.
Linux debian-s-1vcpu-1gb-lon1-01 4.19.0-10-cloud-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian-s-1vcpu-1gb-lon1-01:~#

1


rm -rf ~/.vim
rm ~/.vimrc
vim ~/.vimrc

Here are some safe default options:


syntax on

set noerrorbells
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set nowrap
set smartcase
set noswapfile
set nobackup
set undodir=~/.vim/undodir
set undofile
set incsearch

set colorcolumn=80
highlight ColorColumn ctermbg=0 guibg=lightgrey
	

Then: you can type /set and it will find the set word!! so /word!

To refresh the config:


:source %


mkdir ~/.vim/undodir -p
mkdir ~/
	

PLUGINS (https://github.com/Junegunn/vim-plug) :


curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Then add the following line to vimrc:


call plug#begin('~/.vim/plugged')

Plug 'morhetz/gruvbox'
Plug 'terryma/vim-multiple-cursors'
Plug 'jremmen/vim-ripgrep'
Plug 'tpope/vim-fugitive'
Plug 'leafgarland/typescript-vim'
Plug 'vim-utils/vim-man'
Plug 'lyuts/vim-rtags'
Plug 'neoclide/coc.nvim', {'branch':'release'}
Plug 'mbbill/undotree'

call plug#end()
	

To refresh the config:


:source %
:PlugInstall

type :q to exit the extra vim pan once it finished, and add the following to your vimrc:



colorscheme gruvbox
set background=dark

if executable ('rg')
	let g:rg_derive_root='true'
endif

let g:ctrlp_user_command = ['.git/','git --git-dir=%s/.git ls-files -oc --exclude-standard']
let g:netrw_browse_split=2
let g:netrw_banner=0
let g:netrw_winsize = 25
let g:ctrlp_use_caching = 0


	

To refresh the config:


:w 
:source %

And there you have it!

Now let's add a few conveniences in our vimrc:


curl https://blog.nowhere.moe/vimrc/shortcuts >> ~/.vimrc
vim ~/.vimrc

Now the vim keybinds are:


MODKEY = spacebar

space+pv 		(opens the filetree with size 30) 
space+ARROW 	(moves from tab left to right or up/down)
space+u 		(shows undotree)
:q close a vim tab
space+ps (then type something) and repgrep will find that pattern in your system

space++
space+- (resizes the vertical split vim tabs)

i to insert
ESC to exit insert mode

V to enter visual mode (downarrow to select lines downward)
d to delete
y to copy
:s/match/replace/
ESC to exit Visual Mode

MULTIPLE CURSORS:
CTRL+N

Nihilism

Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8


Contact: nihilist@nowhere.moe (PGP)