Skip to content

Instantly share code, notes, and snippets.

@dk949
Last active December 20, 2024 18:50
Show Gist options
  • Save dk949/489ec49c842d5af82376dd95d6df6a0a to your computer and use it in GitHub Desktop.
Save dk949/489ec49c842d5af82376dd95d6df6a0a to your computer and use it in GitHub Desktop.
*Very* basic vimrc to use on remote computers
" Options
filetype plugin on
filetype plugin indent on
syntax on
set number relativenumber
au InsertLeave * set number relativenumber
au InsertEnter * set number norelativenumber
au FileType cpp,c set formatprg=clang-format
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set wildmenu
set wildignorecase
set ignorecase
set smartcase
set incsearch
set nohlsearch
set path+=**
set splitbelow
set splitright
set mouse=
" Keymap
let mapleader = " "
nnoremap G Gzz
nnoremap vv V
nnoremap V v$
nnoremap Y y$
nnoremap <A-l> gt
inoremap <A-l> gt
nnoremap <A-h> gT
inoremap <A-h> gT
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap Q <nop>
nnoremap <leader>b :e#<CR>
nnoremap <leader>s :update<CR>
nnoremap <leader>t :tabedit<CR>
nnoremap <leader>mf mfgggqG`f
nmap <leader>/ gcc
vmap <leader>/ gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment