Skip to content

Instantly share code, notes, and snippets.

@qtkite
Last active August 22, 2022 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qtkite/824f1fc0530eb2b38bbc6c84e3e0e27e to your computer and use it in GitHub Desktop.
Save qtkite/824f1fc0530eb2b38bbc6c84e3e0e27e to your computer and use it in GitHub Desktop.
updated .vimrc settings for wsl windows
syntax on
let g:python_recommended_style = 0
filetype plugin indent on
" Disable sounds
set visualbell
" https://github.com/geohot/configuration/blob/master/.vimrc
set tabstop=2
set shiftwidth=2
set expandtab
set number
set ai
set ruler
set hlsearch
" Ignore case unless upper case is present in query
set ignorecase smartcase
" Begin searching while typing
set incsearch hlsearch
" Allow the use of the mouse https://stackoverflow.com/questions/7225057/use-mouse-scroll-wheel-in-vim
set mouse=a
" Ctrl backspace delete previous word
noremap! <C-BS> <C-w>
noremap! <C-h> <C-w>
" Pastel theme
colorscheme peachpuff
" Dark highlighting
highlight Visual cterm=NONE ctermfg=NONE ctermbg=237 guibg=#3a3a3a
highlight Search cterm=NONE ctermfg=NONE ctermbg=237 guibg=#3a3a3a
" Light Highlighting
" hi Visual cterm=NONE ctermfg=NONE ctermbg=223 guibg=#ffd7af
" hi Search cterm=NONE ctermfg=NONE ctermbg=223 guibg=#ffd7af
"
" Green comments
highlight Comment ctermfg=green
" Enable pasting on f2
set pastetoggle=<F2>
" WSL Yank support
set clipboard+=unnamedplus
let g:clipboard = {
\ 'name': 'win32yank-wsl',
\ 'copy': {
\ '+': 'win32yank.exe -i --crlf',
\ '*': 'win32yank.exe -i --crlf',
\ },
\ 'paste': {
\ '+': 'win32yank.exe -o --lf',
\ '*': 'win32yank.exe -o --lf',
\ },
\ 'cache_enabled': 0,
\ }
" change this path according to your mount point
let s:clip = '/mnt/c/Windows/System32/clip.exe'
if executable(s:clip)
augroup WSLYank
autocmd!
" Call twice to fix some weird bug
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment