Skip to content

Instantly share code, notes, and snippets.

@dlebech
Last active October 9, 2023 12:53
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 dlebech/829bc7b08ae5a2a078a7 to your computer and use it in GitHub Desktop.
Save dlebech/829bc7b08ae5a2a078a7 to your computer and use it in GitHub Desktop.
My .vimrc, .zshrc and vscode user settings
set nocompatible
filetype off
" Plug is installed with https://github.com/junegunn/vim-plug
"call plug#begin()
"Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
"Plug 'vim-airline/vim-airline'
"Plug 'ctrlpvim/ctrlp.vim'
"Plug 'Yggdroot/indentLine'
"
"Plug 'Shougo/neocomplete.vim'
""Plug 'zchee/deoplete-go', { 'do': 'make' }
"
"Plug 'fatih/vim-go', { 'for': 'go' }
"Plug 'moll/vim-node', { 'for': 'javascript' }
"Plug 'jelera/vim-javascript-syntax', { 'for': 'javascript' }
"Plug 'python-mode/python-mode', { 'for': 'python' }
"call plug#end()
" Make sure filetypes can be detected by plugins.
filetype plugin indent on
syntax on " Syntax highlighting.
let mapleader=',' " Change <leader>
set nowrap " No line wrapping.
set number " Add line numbers
set modeline " Enable reading the modeline.
set tabstop=4 " Set tab to be four spaces.
set shiftwidth=4 " Number of spaces to use for autoindenting.
set expandtab " Disable tabs and use spaces instead.
set magic " Better regex recognition.
set hls " Enable search highlight
set ruler " Show the line and column number
set bs=2 " Make backspace work properly -- especially on Windows.
set synmaxcol=120 " Only syntax highlight first 120 columns for performance reasons.
set laststatus=2 " Make sure status line is always shown
set ignorecase " Case-insensitive search
set smartcase " Case-sensitive search when using uppercase
set incsearch " Search as you type
colorscheme desert " desert colorscheme is the best
" Set the default file-encodings that vim will try when opening a file.
set fileencodings=utf-8,latin1
" Add extra lines and expand to 130 columns so we have a bit of margin to our
" 100 column maximum :-)
set lines=50 columns=130
" Detect less
au BufNewFile,BufRead *.less setlocal filetype=less
" Detect markdown, because .md is Modula-2 by default.
autocmd BufNewFile,BufReadPost *.md setlocal filetype=markdown
" Detect ejs
autocmd BufNewFile,BufReadPost *.ejs setlocal filetype=html
autocmd BufNewFile,BufReadPost *.html setlocal filetype=html
" --- Nerdtree ---
map <F2> :NERDTreeToggle
" -- Python-mode --
let g:pymode_rope = 0
" -- Node.js and JSON --
au FileType javascript setlocal tabstop=2 shiftwidth=2 colorcolumn=100 textwidth=100
au FileType json setlocal tabstop=2 shiftwidth=2
au FileType json let g:indentLine_enabled=0
" -- SASS --
au FileType scss setlocal tabstop=2 shiftwidth=2
" -- HTML --
au FileType html setlocal tabstop=2 shiftwidth=2
" -- golang --
au FileType go setlocal tabstop=4 shiftwidth=4 noexpandtab " Use tabs :-( :-(
au FileType go setlocal list lcs=tab:\|\ " Create tab indent lines
" -- php --
au FileType php setlocal tabstop=4 shiftwidth=4 noexpandtab " Use tabs :-( :-(
" -- neocomplete --
let g:neocomplete#enable_at_startup=1
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
" -- ctrlp --
let g:ctrlp_max_files=0
let g:ctrlp_custom_ignore='node_modules\|git'
" Trailing whitespace remover
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd FileType javascript autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
# Only showing custom options
setopt no_share_history
export GOPATH=/home/david/go
export PATH=/home/david/go/bin:$PATH
export PATH=/home/david/libs/anaconda3/bin:$PATH
export AZURE_DEV_COLLECT_TELEMETRY=no
export DOTNET_CLI_TELEMETRY_OPTOUT=1
dockercleanimages() {
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi
}
dockercleancontainers() {
docker ps -a -q -f status=exited -f status=created | xargs docker rm
}
gitcleanbranches() {
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
}
{
"[javascriptreact]": {
"editor.tabSize": 2
},
"[go]": {
"editor.insertSpaces": false
},
"[html]": {
"editor.tabSize": 2,
},
"[javascript]": {
"editor.tabSize": 2,
},
"[typescript]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescriptreact]": {
"editor.tabSize": 2,
},
"[svelte]": {
"editor.tabSize": 2,
},
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"editor.tabSize": 4,
},
"[python]": {
"editor.tabSize": 4,
},
"[sql]": {
"editor.tabSize": 2
},
"explorer.confirmDragAndDrop": false,
"extensions.ignoreRecommendations": false,
"todohighlight.keywords": [
"XXX:"
],
"files.exclude": {
"**/*.pyc": true
},
"python.formatting.provider": "black",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=cv2"
],
"jupyter.sendSelectionToInteractiveWindow": true,
"jupyter.askForKernelRestart": false,
"jupyter.interactiveWindowMode": "perFile",
"workbench.editorAssociations": {
"*.ipynb": "jupyter-notebook"
},
"editor.cursorStyle": "line",
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.lineNumbers": "on",
"editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-",
"editor.wordWrap": "off",
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"telemetry.telemetryLevel": "off",
"svelte.enable-ts-plugin": true,
"jest.autoRun": "off",
"workbench.startupEditor": "none",
"terminal.integrated.persistentSessionReviveProcess": "never",
"terminal.integrated.enablePersistentSessions": false,
"jupyter.interactiveWindow.creationMode": "perFile",
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"vim.handleKeys": {
"<C-p>": false,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment