Skip to content

Instantly share code, notes, and snippets.

@artronics
Last active January 25, 2018 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artronics/598934c60c94d6ab9ed14a10f7ffbc3d to your computer and use it in GitHub Desktop.
Save artronics/598934c60c94d6ab9ed14a10f7ffbc3d to your computer and use it in GitHub Desktop.
new linux setup
"""""KEY BINDINGS
let mapleader = ","
imap jj <Esc>
nnoremap ; :
"nsert a new-line after the current line by pressing Enter (Shift-Enter for inserting a line before the current line)
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
"be coool!
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
#inoremap <up> <nop>
#inoremap <down> <nop>
#inoremap <left> <nop>
#inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
"map tab to % for easier match *{[
nnoremap <tab> %
vnoremap <tab> %
"to navigate between windows
nnoremap <S-h> <C-w>h
nnoremap <S-j> <C-w>j
nnoremap <S-k> <C-w>k
nnoremap <S-l> <C-w>l
"when you forgot to sudo before editing a file that requires root
cmap w!! w !sudo tee % >/dev/null
"open a new vertical split and switch over to it
nnoremap ,w <C-w>v<C-w>l
"Plug
call plug#begin('~/.local/share/nvim/plugged')
Plug '907th/vim-auto-save'
call plug#end()
"" space setting
set autoindent
set list
set shiftround
set shiftwidth=2
set smartindent
set smarttab
set tabstop=2
"" appearance
syntax on
set backspace=indent,eol,start
set colorcolumn=120
set completeopt=menu
set hlsearch
set inccommand=nosplit
set incsearch
set shortmess=a
set noshowcmd
set showmatch
set laststatus=0
set noshowmode
set splitbelow
set splitright
set wrap
" keymap
let mapleader = ","
imap jj <Esc>
nnoremap ; :
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
nnoremap <tab> %
vnoremap <tab> %
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
nnoremap gj j
nnoremap gk k
nnoremap <silent> <esc><esc> :nohlsearch<cr>
"" auto-save
let g:auto_save = 1
let g:auto_save_in_insert_mode = 0
let g:auto_save_silent = 1
@artronics
Copy link
Author

artronics commented Jan 25, 2018

sudo apt-get install zsh curl git neovim
Change name git config --global user.name ""
Change email address git config --global use.email ""
Change email address ssh-keygen -t rsa -C "your_email@example.com"

mkdir ~/projects

install ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
change theme to "avit"

@artronics
Copy link
Author

install vim plug
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment