Skip to content

Instantly share code, notes, and snippets.

@choestelus
Created February 3, 2021 15:22
Show Gist options
  • Save choestelus/5aee3b6c2b4b43f2234fcc745f76d9ca to your computer and use it in GitHub Desktop.
Save choestelus/5aee3b6c2b4b43f2234fcc745f76d9ca to your computer and use it in GitHub Desktop.
dot-configuration
# Homebrew zsh completion configuration initialize here
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
# plugin declaration before source-ing oh-my-zsh
plugins=(git autojump fd fzf git-prompt kubectl ripgrep golang zsh-nvm)
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
{
"languageserver": {
"terraform": {
"command": "terraform-ls",
"filetypes": ["terraform"],
"args": ["serve"],
"initializationOptions": {}
}
}
}
enable-ssh-support
pinentry-program /usr/local/bin/pinentry-mac
default-cache-ttl 7200
max-cache-ttl 14400
default-cache-ttl-ssh 7200
max-cache-ttl-ssh 14400
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 2 46 47 49 1
sort_key=46
sort_direction=1
tree_sort_key=0
tree_sort_direction=1
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=1
highlight_threads=1
highlight_changes=0
highlight_changes_delay_secs=5
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
show_merged_command=0
tree_view=0
tree_view_always_by_pid=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_one=1
show_cpu_usage=1
show_cpu_frequency=0
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
enable_mouse=1
delay=15
left_meters=LeftCPUs2 Memory Swap
left_meter_modes=1 1 1
right_meters=RightCPUs2 Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2
" credits to @jigkoxsee
set nocompatible
if has('vim_starting')
set runtimepath+=~/.config/nvim/
endif
call plug#begin('~/.local/share/nvim/plugged')
" Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-speeddating'
Plug 'junegunn/vim-easy-align'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'
Plug 'lokaltog/vim-easymotion'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-surround'
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'christoomey/vim-tmux-navigator'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" ==== colorschemes ==== "
Plug 'rakr/vim-one'
Plug 'ayu-theme/ayu-vim'
Plug 'tyrannicaltoucan/vim-quantum'
" ==== syntax highlight ==== "
Plug 'cespare/vim-toml'
Plug 'kien/rainbow_parentheses.vim'
Plug 'guns/vim-clojure-highlight'
" ==== languages specific ===="
Plug 'elzr/vim-json'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'tpope/vim-classpath'
Plug 'tpope/vim-salve'
Plug 'elixir-editors/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'hashivim/vim-terraform'
" ==== Autocomplete ===="
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-endwise'
Plug 'vim-ruby/vim-ruby'
Plug 'dense-analysis/ale'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" ==== Plugin order matters ==== "
call plug#end()
filetype plugin indent on
" ========== coc.nvim ========== "
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Add status line support, for integration with other plugin, checkout `:h coc-status`
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Or use `complete_info` if your vim support it, like:
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
" ============================== "
let g:ale_sign_column_always = 1
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" ====== key bindings and configuration ====== "
set backspace=indent,eol,start
set fileformat=unix
set autoread
" ========= Interface Configuration ========= "
" set t_Co=256
let &t_ut=''
set termguicolors
set hidden
set t_8b=[48;2;%lu;%lu;%lum
set t_8f=[38;2;%lu;%lu;%lum
set ruler
" scroll speed
set scroll=8
" set line number and syntax
set nu
syntax on
" show line number and command being entered
set showcmd number
" set fonts
set encoding=utf-8
set guifont=Source\ Code\ Pro\ for\ Powerline\ 10,DejaVu\ Sans\ Mono\ for\ Powerline\ 10,DejaVu\ Sans\ Mono\ 10
let g:terraform_fmt_on_save=1
" airline configurations
" let g:rigel_airline=1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#ale#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme = 'one'
" set laststatus=2
" ===== Syntax Configuration ===== "
let g:vim_json_syntax_conceal = 0
let g:indentLine_noConcealCursor=""
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
set statusline+=%#warningmsg#
set statusline+=%*
set completeopt=longest,menuone
" colorscheme
colorscheme one
set background=dark
" ==== Indentations ==== "
let delimitMate_expand_cr = 1
" set tab stops
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab
set autoindent
au FileType html setl sw=2 sts=2 et
au FileType php setl sw=4 sts=4 et
au FileType python setl sw=4 sts=4 et
au FileType ruby setl sw=2 sts=2 et
au FileType yaml setl sw=2 sts=2 et
au FileType json setl et
" ==== Go Specific ==== "
let g:go_def_mode = 'gopls'
let g:go_info_mode = 'gopls'
let g:go_highlight_functions = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_format_strings = 1
let g:go_highlight_variable_declarations = 1
let g:go_highlight_variable_assignments = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_generate_tags = 1
let g:go_auto_type_info = 1
let g:go_fmt_command = 'goimports'
let g:gometalinter_enabled = ['vet']
let g:go_metalinter_autosave = 0
"
" Search
nnoremap <C-p> :call fzf#run(fzf#wrap({'source': 'fd -t f . $(git rev-parse --show-toplevel)','options': '--preview="bat --color=always {}"'}))<cr>
"" search by buffer name
nnoremap <silent> <leader>s :call fzf#run(fzf#wrap({'source': map(range(1, bufnr('$')), 'bufname(v:val)'), 'options': '--preview="bat --color=always {}"'}))<cr>
"" Pass current word to :Rg when invoke
nnoremap <silent> <Leader>rg :Rg <C-R><C-W><CR>
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
"" Easymotion
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
nmap <Leader>w <Plug>(easymotion-overwin-w)
nmap <Leader>L <Plug>(easymotion-overwin-line)
"" map <Space> as <Leader>, this don't change to current leader's key
"map <Space> <Leader>
" Remap the leader key to signle quote
let mapleader = "'"
" Run commands with semicolon
nnoremap ; :
" display indent guild
let g:indent_guides_enable_on_vim_startup = 1
" My Define keymap
"" OmniComplete on tab - Change <Tab> in InsertMode to Ctrl-X + Ctrl-O
" imap <Tab> <C-x><C-o>
map <C-n> :NERDTreeToggle<CR>
"
" Buffer
" close it with out closing window
command! BD :bn|:bd#
noremap <Leader>bd :BD<CR>
"" jump between go symbol/function
nnoremap <leader><C-r> :GoDecls<cr>
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>b <Plug>(go-build)
au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <leader>c <Plug>(go-coverage-toggle)
" Show a list of interfaces which is implemented by the type under your cursor
au FileType go nmap <Leader>s <Plug>(go-implements)
" Show type info for the word under your cursor
au FileType go nmap <Leader>i <Plug>(go-info)
" Rename the identifier under the cursor to a new name
" au FileType go nmap <Leader>e <Plug>(go-rename)
let $NVIM_PYTHON_LOG_FILE='/tmp/nvim_log'
let $NVIM_PYTHON_LOG_LEVEL='DEBUG'
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Launch apps by left control & option+letters.",
"manipulators": [
{
"from": {
"key_code": "t",
"modifiers": {
"mandatory": [
"left_control",
"left_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"shell_command": "open -n '/Applications/kitty.app'"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 21,
"vendor_id": 12431
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": [
{
"from": {
"key_code": "left_command"
},
"to": {
"key_code": "left_option"
}
},
{
"from": {
"key_code": "left_option"
},
"to": {
"key_code": "left_command"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 402,
"vendor_id": 1241
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": [
{
"from": {
"key_code": "left_option"
},
"to": {
"key_code": "left_command"
}
},
{
"from": {
"key_code": "left_command"
},
"to": {
"key_code": "left_option"
}
}
]
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": {
"consumer_key_code": "display_brightness_decrement"
}
},
{
"from": {
"key_code": "f2"
},
"to": {
"consumer_key_code": "display_brightness_increment"
}
},
{
"from": {
"key_code": "f3"
},
"to": {
"key_code": "mission_control"
}
},
{
"from": {
"key_code": "f4"
},
"to": {
"key_code": "launchpad"
}
},
{
"from": {
"key_code": "f5"
},
"to": {
"key_code": "illumination_decrement"
}
},
{
"from": {
"key_code": "f6"
},
"to": {
"key_code": "illumination_increment"
}
},
{
"from": {
"key_code": "f7"
},
"to": {
"consumer_key_code": "rewind"
}
},
{
"from": {
"key_code": "f8"
},
"to": {
"consumer_key_code": "play_or_pause"
}
},
{
"from": {
"key_code": "f9"
},
"to": {
"consumer_key_code": "fast_forward"
}
},
{
"from": {
"key_code": "f10"
},
"to": {
"consumer_key_code": "mute"
}
},
{
"from": {
"key_code": "f11"
},
"to": {
"consumer_key_code": "volume_decrement"
}
},
{
"from": {
"key_code": "f12"
},
"to": {
"consumer_key_code": "volume_increment"
}
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "escape"
}
}
],
"virtual_hid_keyboard": {
"country_code": 0,
"mouse_key_xy_scale": 100
}
}
]
}
# $HOME/.config/kitty/kitty.conf
font_family JetBrainsMono Nerd Font
font_size 13
layout tall
adjust_column_width 90%
disable_ligatures never
input_delay 1
background_opacity 1
scrollback_lines 50000
editor nvim
update_check_interval 24
enable_audio_bell no
close_on_child_death yes
initial_window_width 160c
initial_window_height 48c
remember_window_size no
sync_to_monitor yes
url_style single
open_url_modifiers ctrl
tab_bar_style powerline
tab_title_template {index}: {title}
active_tab_font_style bold
macos_option_as_alt left
macos_quit_when_last_window_closed yes
macos_thicken_font 0.2
map alt+left send_text all \x1b\x62
map alt+right send_text all \x1b\x66
map ctrl+alt+1 goto_tab 1
map ctrl+alt+2 goto_tab 2
map ctrl+alt+3 goto_tab 3
map ctrl+alt+4 goto_tab 4
map ctrl+alt+5 goto_tab 5
map ctrl+alt+6 goto_tab 6
map ctrl+alt+7 goto_tab 7
map ctrl+alt+8 goto_tab 8
map ctrl+alt+9 goto_tab 9
include ./theme.conf
ln -s $(pwd)/kitty-themes/themes/OneDark.conf theme.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment