├── .bash_profile ├── .gitattributes ├── .gitconfig ├── .gitignore ├── .my.cnf ├── .profile ├── .vimrc ├── .zshrc ├── README.md ├── config ├── base.vim ├── colors.vim ├── keymap.vim ├── plugin-settings.vim ├── plugins.vim └── ui.vim ├── custom.zsh-theme ├── iTermProfile.json ├── install-neovim.sh ├── install.sh ├── mongod.conf ├── nvim ├── base.vim ├── coc-settings.json ├── colors │ └── custom.vim ├── init.vim ├── keymap.vim ├── lua │ ├── efm │ │ ├── autopep8.lua │ │ ├── eslint.lua │ │ ├── luafmt.lua │ │ ├── prettier.lua │ │ └── rustfmt.lua │ ├── localconfig.lua │ ├── plugins.lua │ └── plugins │ │ ├── comment-nvim.lua │ │ ├── dressing.lua │ │ ├── firenvim.lua │ │ ├── focus.lua │ │ ├── gitsigns.lua │ │ ├── hop.lua │ │ ├── lsp-inlayhints.lua │ │ ├── lsp_extensions.lua │ │ ├── lspkind-nvim.lua │ │ ├── neogit.lua │ │ ├── neomake.lua │ │ ├── neorg.lua │ │ ├── nvim-cmp-tabnine.lua │ │ ├── nvim-cmp.lua │ │ ├── nvim-dap.lua │ │ ├── nvim-lspconfig.lua │ │ ├── nvim-lsputils.lua │ │ ├── nvim-lualine.lua │ │ ├── nvim-tree.lua │ │ ├── rest-nvim.lua │ │ ├── telescope.lua │ │ ├── toggleterm.lua │ │ └── treesitter.lua └── plugin │ └── packer_compiled.lua └── stylua.toml /.bash_profile: -------------------------------------------------------------------------------- 1 | export PATH="/usr/local/sbin:$PATH" 2 | export PATH="/usr/local/mysql/bin:$PATH" 3 | 4 | export LANG="en_US.UTF-8" 5 | export LC_ALL="en_US.UTF-8" 6 | export LC_TYPE="UTF-8" 7 | 8 | alias ll='ls -lGa' 9 | alias cls=clear 10 | alias composer="php /usr/local/bin/composer.phar" 11 | 12 | source /usr/local/git/contrib/completion/git-completion.bash 13 | 14 | source /usr/local/lib/dnx/bin/dnvm.sh 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.gif diff=image 2 | *.jpg diff=image 3 | *.png diff=image 4 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | email = T.Kallup@gmail.com 3 | name = Tomáš Kallup 4 | signingkey = 774B849F1E711FC2 5 | [core] 6 | editor = "$EDITOR" 7 | pager = diff-so-fancy | less --tabs=4 -RFX 8 | excludesfile = ~/.gitignore_global 9 | attributesfile = ~/.gitattributes 10 | [color] 11 | ui = true 12 | [color "branch"] 13 | current = green bold 14 | local = blue 15 | remote = cyan 16 | [color "diff-highlight"] 17 | oldNormal = 196 bold 18 | oldHighlight = 196 bold 52 19 | newNormal = 46 bold 20 | newHighlight = 46 bold 22 21 | [color "diff"] 22 | meta = yellow 23 | frag = magenta bold 24 | old = 196 bold 25 | new = 46 bold 26 | commit = yellow bold 27 | whitespace = red reverse 28 | [color "status"] 29 | added = green 30 | changed = cyan 31 | unmerged = yellow 32 | untracked = red 33 | [alias] 34 | bcleanup = !git fetch --prune && git branch --merged | grep -E -v \"(^\\*|master|develop|staging)\" > /tmp/git-branch-cleanup && $EDITOR /tmp/git-branch-cleanup && cat /tmp/git-branch-cleanup | xargs git branch -d 35 | pbcleanup = !git fetch --prune && git branch -vv | grep ': gone]' | sed \"s/^\\s\\+\\([^ ]\\+\\).*/\\1/\" | grep -E -v \"(^\\*|master|develop|staging)\" > /tmp/git-branch-cleanup && $EDITOR /tmp/git-branch-cleanup && cat /tmp/git-branch-cleanup | xargs git branch -D 36 | rbcleanup = !git fetch --prune && git branch -r --merged | grep -E -v \"(^\\*|master|develop|staging)\" > /tmp/git-branch-cleanup && $EDITOR /tmp/git-branch-cleanup && sed -i \"\" \"s/origin\\///\" /tmp/git-branch-cleanup && cat /tmp/git-branch-cleanup | xargs git push origin --delete 37 | a = add 38 | aa = add * 39 | ac = !git diff --name-only --diff-filter=U | xargs git add 40 | ap = add -p 41 | b = branch 42 | c = commit 43 | ca = commit -a 44 | ch = checkout 45 | cm = commit -m 46 | cam = commit -am 47 | chp = cherry-pick 48 | chpc = cherry-pick --continue 49 | d = diff 50 | f = fetch 51 | fp = fetch --prune 52 | fc = !git diff --name-only --diff-filter=U | xargs $EDITOR 53 | m = merge 54 | md = merge develop 55 | r = reset 56 | rh = reset HEAD 57 | rb = rebase 58 | rbc = rebase --continue 59 | rba = rebase --abort 60 | rbs = rebase --skip 61 | s = status -sb 62 | st = stash 63 | sta = stash apply 64 | p = push 65 | pf = push --force-with-lease 66 | pl = pull 67 | psuo = !git push --set-upstream origin $(git branch --show-current) 68 | psu = push --set-upstream 69 | dt = difftool 70 | mt = mergetool 71 | fixc = "!$EDITOR `git diff --name-only --diff-filter=U`" 72 | bi = !git checkout $(git branch | sed '/HEAD/d' | sed -e 's/*\\?\\s\\+\\(remotes\\/origin\\/\\)\\?//' | sort -u | fzf) 73 | bia = !git checkout $(git branch -a | sed '/HEAD/d' | sed -e 's/*\\?\\s\\+\\(remotes\\/origin\\/\\)\\?//' | sort -u | fzf) 74 | lg = "log --format='%C(auto) %h %s'" 75 | 76 | [pull] 77 | rebase = true 78 | [rebase] 79 | autoStash = true 80 | [gpg] 81 | program = gpg2 82 | [commit] 83 | gpgSign = true 84 | [diff-so-fancy] 85 | first-run = false 86 | [diff] 87 | tool = nvimdiff 88 | [difftool "nvimdiff"] 89 | cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"" 90 | [merge] 91 | tool = nvimdiff 92 | [mergetool "nvimdiff"] 93 | cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" \"$MERGED\" -c 'wincmd w' -c 'wincmd w' -c 'wincmd J'" 94 | [mergetool] 95 | keepBackup = false 96 | [credential] 97 | helper = store 98 | [push] 99 | autoSetupRemote = true 100 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | todo/todos 2 | -------------------------------------------------------------------------------- /.my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | default-authentication-plugin=mysql_native_password 3 | sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' 4 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | # Preset envs 2 | [ -r ~/.config/shell/envs ] && source ~/.config/shell/envs 3 | 4 | # Machine private envs 5 | [ -r ~/.env ] && source ~/.env 6 | 7 | # Aliases 8 | [ -r ~/.config/shell/aliases ] && source ~/.config/shell/aliases 9 | 10 | # Nvm 11 | [ -r /usr/share/nvm/init-nvm.sh ] && source /usr/share/nvm/init-nvm.sh 12 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | let s:path = '~/.vim/config/' 2 | 3 | func LoadConfig(name) 4 | exec 'source' s:path . a:name . '.vim' 5 | endfunc 6 | 7 | call LoadConfig('plugins') 8 | call LoadConfig('base') 9 | call LoadConfig('plugin-settings') 10 | call LoadConfig('keymap') 11 | call LoadConfig('colors') 12 | call LoadConfig('ui') 13 | 14 | set nocompatible 15 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # Preset envs 2 | [ -r ~/.config/shell/envs ] && source ~/.config/shell/envs 3 | 4 | # Machine private envs 5 | [ -r ~/.env ] && source ~/.env 6 | 7 | # Aliases 8 | [ -r ~/.config/shell/aliases ] && source ~/.config/shell/aliases 9 | 10 | # LS_COLORS 11 | [ -r ~/.local/share/lscolors.sh ] && source ~/.local/share/lscolors.sh 12 | 13 | autoload -Uz promptinit 14 | promptinit 15 | 16 | # Plugin manager 17 | source /usr/share/zsh/scripts/zplug/init.zsh 18 | 19 | zplug "~/.config/zsh/themes/custom", from:local 20 | zplug "zdharma-continuum/fast-syntax-highlighting", defer:2 21 | zplug "MichaelAquilina/zsh-autoswitch-virtualenv" 22 | zplug "buonomo/yarn-completion", defer:2 23 | zplug "arzzen/calc.plugin.zsh" 24 | zplug "b4b4r07/enhancd", use:init.sh 25 | 26 | # Install plugins if there are plugins that have not been installed 27 | if ! zplug check --verbose; then 28 | printf "Install? [y/N]: " 29 | if read -q; then 30 | echo; zplug install 31 | fi 32 | fi 33 | 34 | # Then, source plugins and add commands to $PATH 35 | zplug load 36 | 37 | ZSH_THEME='custom' 38 | 39 | # Better arrow search 40 | autoload -U up-line-or-beginning-search 41 | autoload -U down-line-or-beginning-search 42 | zle -N up-line-or-beginning-search 43 | zle -N down-line-or-beginning-search 44 | bindkey -e 45 | bindkey "^[[A" up-line-or-beginning-search # Up 46 | bindkey "^[[B" down-line-or-beginning-search # Down 47 | 48 | # Edit current command in editor 49 | autoload -U edit-command-line 50 | zle -N edit-command-line 51 | bindkey '^xe' edit-command-line 52 | 53 | # Allow shift-tab for backwards complete 54 | bindkey '^[[Z' reverse-menu-complete 55 | 56 | # Run-help for figuring stuff out! 57 | autoload -Uz run-help 58 | (( $+aliases[run-help] )) && unalias run-help 59 | 60 | zle_highlight+=(paste:none) 61 | 62 | # History setup 63 | HISTFILE=~/.zsh_history 64 | HISTSIZE=10000 65 | SAVEHIST=10000 66 | setopt EXTENDED_HISTORY 67 | setopt HIST_EXPIRE_DUPS_FIRST 68 | setopt HIST_IGNORE_ALL_DUPS # delete old dups when saving 69 | setopt HIST_IGNORE_SPACE # ignore empty spaces 70 | setopt HIST_FIND_NO_DUPS # dont show duplicates 71 | setopt HIST_SAVE_NO_DUPS # dont save duplicates 72 | setopt HIST_REDUCE_BLANKS # remove superfluous blanks from history items 73 | setopt INC_APPEND_HISTORY # save history entries as soon as they are entered 74 | 75 | setopt auto_cd # cd by typing directory name if it's not a command 76 | 77 | zstyle ':completion:*' completer _complete _ignored _files 78 | 79 | #alsi 80 | #task long 81 | 82 | # The next line updates PATH for the Google Cloud SDK. 83 | if [ -f '/opt/google-cloud-cli/path.zsh.inc' ]; then . '/opt/google-cloud-cli/path.zsh.inc'; fi 84 | 85 | # The next line enables shell command completion for gcloud. 86 | if [ -f '/opt/google-cloud-cli/completion.zsh.inc' ]; then . '/opt/google-cloud-cli/completion.zsh.inc'; fi 87 | 88 | eval "$(direnv hook zsh)" 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | configurations for vim, etc. 3 | -------------------------------------------------------------------------------- /config/base.vim: -------------------------------------------------------------------------------- 1 | filetype plugin on 2 | 3 | " Basic VIM settings 4 | set showcmd 5 | set showmode 6 | set number 7 | set relativenumber 8 | set laststatus=3 " Enable the status bar to always show 9 | set hidden " Set hidden to allow buffers to be browsed 10 | set breakindent " Make word wrapping behave like it does in every other sane text editor 11 | set hlsearch " Highlight search results 12 | set incsearch " Make search jump: 13 | set gdefault " assume the /g flag on :s substitutions to replace all matches in a line 14 | set autoread " Make Vim automatically open changed files (e.g. changed after a Git commit) 15 | 16 | set backspace=indent,eol,start " allow backspacing over everything in insert mode 17 | set autoindent " always set autoindenting on 18 | set tabstop=2 " The default is 8 which is MASSIVE!! 19 | set softtabstop=0 20 | set expandtab 21 | set shiftwidth=2 22 | set smarttab 23 | set wildmenu " visually autocomplete the command menu 24 | set ttyfast " sends more characters to the screen for fast terminal 25 | set nolazyredraw 26 | set showmatch " highlight matching [{()}] 27 | set nofoldenable " disable folding 28 | set wrap linebreak 29 | set textwidth=0 30 | set wrapmargin=0 31 | set formatoptions+=l 32 | set formatoptions-=t 33 | set virtualedit=onemore 34 | set ignorecase " ignore case when searching 35 | set smartcase " don't ignore Captials when present 36 | set splitbelow " puts new splits to the bottom 37 | set splitright " and to right 38 | set synmaxcol=400 " Prevent long lines from ruining my life 39 | set completeopt+=preview 40 | set guicursor=n-v-c-sm:hor20,i-ci-ve:ver25,r-cr-o:hor20,a:Cursor 41 | set updatetime=500 42 | set title 43 | set titleold=st 44 | 45 | " Show tabs and spaces 46 | set listchars=tab:›\ ,trail:-,extends:#,nbsp:. 47 | set list 48 | 49 | syntax on 50 | 51 | " Backups 52 | set backupdir=~/.vim/SWP 53 | set directory=~/.vim/SWP 54 | set writebackup 55 | set backupcopy=yes 56 | 57 | " Undo directory 58 | set undofile 59 | set undodir=$HOME/.vim/undo 60 | set undolevels=150 61 | 62 | set scrolloff=5 63 | 64 | " Tags 65 | set tags=./.vimtags;,.vimtags; 66 | 67 | " Ignore the node_modules folder and all its subfolders 68 | set wildignore+=**/node_modules/** 69 | 70 | " Setup GUI 71 | set guifont=SauceCodePro\ Nerd\ Font:h16 72 | 73 | " Set language 74 | language en_US.UTF-8 75 | 76 | " Fix session saving 77 | set ssop-=options 78 | set ssop-=folds 79 | 80 | " Remove whitespaces on save 81 | "autocmd BufWritePre * :%s/\s\+$//e 82 | 83 | " Current workaround for long classes 84 | autocmd BufReadPost *.tsx,*.ts,*.jsx,*.js :syntax sync fromstart 85 | 86 | autocmd BufNewFile,BufRead calcurse-note.* :set filetype=markdown 87 | 88 | " Set the default clipboard 89 | if has('unnamedplus') 90 | set clipboard=unnamedplus 91 | else 92 | set clipboard=unnamed 93 | endif 94 | 95 | " Character encoding 96 | if has("multi_byte") 97 | if &termencoding == "" 98 | let &termencoding = &encoding 99 | endif 100 | set encoding=utf-8 101 | setglobal fileencoding=utf-8 102 | set fileencodings=ucs-bom,utf-8,latin1 103 | endif 104 | 105 | let g:html_indent_inctags = "html,body,head,tbody,span,b,a,div" 106 | 107 | " Remember cursor pos 108 | autocmd BufReadPost * 109 | \ if line("'\"") > 1 && line("'\"") <= line("$") | 110 | \ exe "normal! g`\"" | 111 | \ endif 112 | 113 | " Custom function to get current synstack under cursor 114 | function! SynStack() 115 | if !exists("*synstack") 116 | return 117 | endif 118 | echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') 119 | endfunc 120 | 121 | " Fix filetype for jsx files 122 | au BufNewFile,BufRead *.jsx set filetype=javascript.jsx 123 | 124 | " runtime macros/matchit.vim 125 | -------------------------------------------------------------------------------- /config/colors.vim: -------------------------------------------------------------------------------- 1 | " Highlight current line number 2 | hi CursorLineNR cterm=bold ctermfg=1 3 | 4 | " Better Visual highlight 5 | hi Visual ctermbg=0 ctermfg=NONE 6 | 7 | " Ale colors 8 | hi link ALEWarningSign String 9 | hi link ALEErrorSign Title 10 | 11 | " Change colors 12 | hi Directory guifg=#5fff87 ctermfg=3 13 | hi NERDTreeOpenable guifg=#00ff00 ctermfg=12 14 | hi NERDTreeClosable guifg=#af0000 ctermfg=1 15 | hi WarningMsg cterm=bold ctermfg=1 ctermbg=16 16 | hi type ctermfg=10 17 | hi Special ctermfg=11 18 | hi Search ctermbg=2 ctermfg=0 19 | 20 | " Fix HTML 21 | hi link htmlTag Identifier 22 | hi link htmlTagName statement 23 | hi link htmlEndTag Identifier 24 | 25 | " Fix XML colors 26 | hi link xmlTag htmlTag 27 | hi link xmlTagName htmlTagName 28 | hi link xmlEndTag htmlEndTag 29 | 30 | " Fix typescript 31 | hi link tsxTagName htmlTagName 32 | hi link typescriptTypeReference Type 33 | hi link typescriptInterfaceName typescriptTypeReference 34 | hi link typescriptAliasDeclaration typescriptTypeReference 35 | hi link typescriptObjectLabel specialkey 36 | hi link typescriptMember typescriptObjectLabel 37 | hi link typescriptPredefinedType typescriptTypeReference 38 | hi link typescriptVariable keyword 39 | hi link typescriptOperator keyword 40 | hi link typescriptEnum typescriptInterfaceName 41 | hi link typescriptEnumKeyword Keyword 42 | hi link typescriptDestructureVariable normal 43 | hi link typescriptDestructureLabel specialkey 44 | 45 | " Fix javascript 46 | hi link javascriptObjectLabel specialkey 47 | hi link javascriptVariable keyword 48 | hi link javascriptExport keyword 49 | hi link jsxAttrib type 50 | hi link javascriptArrowFuncArg PreProc 51 | hi link jsClassDefinition cleared 52 | hi link jsObjectKey specialkey 53 | hi link jsFunctionKey specialkey 54 | hi link jsObjectFuncName specialkey 55 | hi link jsClassFuncName specialkey 56 | hi link jsFuncCall cleared 57 | hi link jsThis Type 58 | hi link jsSuper Type 59 | hi link jsOperator cleared 60 | hi link jsFuncArgs specialkey 61 | hi link jsStorageClass keyword 62 | hi link jsImport keyword 63 | hi link jsFrom keyword 64 | hi link jsExport keyword 65 | hi link jsExportDefault keyword 66 | hi link jsModuleAs keyword 67 | hi link jsOperatorKeyword keyword 68 | 69 | " Fix SpellBad for strings etc. 70 | hi SpellBad ctermbg=9 gui=undercurl guisp=Red ctermfg=white 71 | 72 | " Fix LSP reference 73 | hi lspReference ctermfg=white ctermbg=240 74 | 75 | " Fix CoC 76 | hi CocUnderline ctermbg=52 cterm=none gui=none 77 | hi CocFloating ctermbg=black ctermfg=yellow 78 | hi CocInfoFloat ctermfg=red 79 | hi CocErrorSign ctermfg=160 80 | -------------------------------------------------------------------------------- /config/keymap.vim: -------------------------------------------------------------------------------- 1 | " Disable arrow keys 2 | map :echoerr "What are you doing?" 3 | map :echoerr "What are you doing?" 4 | map :echoerr "What are you doing?" 5 | map :echoerr "What are you doing?" 6 | 7 | " Change leader key to "space" 8 | let mapleader="\" 9 | 10 | " Setup custom shortcuts 11 | map K gt 12 | map J gT 13 | " Remove highlights from search with f 14 | map f :noh 15 | 16 | map w :w 17 | map q :q 18 | map Q :qall 19 | map x :x 20 | map X :xall 21 | map n :tabnew 22 | map b :CtrlPBuffer 23 | "map h :LspHover 24 | "map rr :LspReferences 25 | "map rn :LspNextReference 26 | 27 | map ad :ALEDetail 28 | map af :ALEFix 29 | 30 | " Session saving 31 | map ss :mksession! ~/.vim_session 32 | map sl :source ~/.vim_session 33 | 34 | " Terminal in vim 35 | map t :terminal 36 | 37 | ino jk 38 | ino kj 39 | cno jj 40 | vno v 41 | 42 | " Reindent whole file and go back to curosr 43 | " map = gg=G`` 44 | " Repalced with coc formatter 45 | map = (coc-format) 46 | 47 | " Copy whole file and go back to curosr 48 | map y ggyG`` 49 | 50 | nmap , (easymotion-overwin-f) 51 | nmap , (easymotion-overwin-f2) 52 | 53 | " Leader + q closes all windows in diffmode 54 | if &diff 55 | map q :qall 56 | endif 57 | 58 | nnoremap j j 59 | nnoremap k k 60 | nnoremap l l 61 | nnoremap h h 62 | nnoremap J J 63 | nnoremap K K 64 | nnoremap L L 65 | nnoremap H H 66 | nnoremap p p 67 | 68 | nnoremap vp :vsp \| bp 69 | nnoremap vn :vsp \| bn 70 | nnoremap vd :vsp \| call CocActionAsync('jumpDefinition') 71 | 72 | " NERDtree settings 73 | map :NERDTreeFind 74 | map m :NERDTreeToggle 75 | let NERDTreeMapActivateNode='l' 76 | let NERDTreeMapCloseChildren='h' 77 | 78 | " Go back 79 | nmap gb :bp 80 | " Go next 81 | nmap gn :next 82 | 83 | " LSP 84 | "nmap gd :LspDefinition 85 | "nmap gi :LspImplementation 86 | "nmap gr :LspReferences 87 | "nmap i :LspCodeAction 88 | 89 | " CoC 90 | nmap gd :call CocActionAsync('jumpDefinition') 91 | nmap gi (coc-implementation) 92 | nmap rr (coc-references) 93 | nmap rm (coc-rename) 94 | nmap i (coc-codeaction) 95 | nmap d (coc-diagnostic-info) 96 | nmap vd :vsp(coc-definition) 97 | nmap gh :call CocActionAsync('doHover') 98 | 99 | " use for trigger completion and navigate next complete item 100 | inoremap 101 | \ pumvisible() ? "\" : 102 | \ check_back_space() ? "\" : 103 | \ coc#refresh() 104 | inoremap pumvisible() ? "\" : "\" 105 | 106 | function! s:check_back_space() abort 107 | let col = col('.') - 1 108 | return !col || getline('.')[col - 1] =~ '\s' 109 | endfunction 110 | 111 | " use to confirm completion (for autoimporting etc) 112 | "inoremap pumvisible() ? "\" : "\" 113 | 114 | " Asyncomplete 115 | "inoremap pumvisible() ? "\" : "\" 116 | "inoremap pumvisible() ? "\" : "\" 117 | " 118 | 119 | " FZF 120 | nmap g [fzf-p] 121 | xmap g [fzf-p] 122 | 123 | nnoremap [fzf-p]p :CocCommand fzf-preview.FromResources project_mru git 124 | nnoremap [fzf-p]gs :CocCommand fzf-preview.GitStatus 125 | nnoremap [fzf-p]ga :CocCommand fzf-preview.GitActions 126 | nnoremap [fzf-p]b :CocCommand fzf-preview.Buffers 127 | nnoremap [fzf-p]B :CocCommand fzf-preview.AllBuffers 128 | nnoremap [fzf-p]o :CocCommand fzf-preview.FromResources buffer project_mru 129 | nnoremap [fzf-p] :CocCommand fzf-preview.Jumps 130 | nnoremap [fzf-p]g; :CocCommand fzf-preview.Changes 131 | nnoremap [fzf-p]/ :CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query="'" 132 | nnoremap [fzf-p]* :CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query="'=expand('')" 133 | nnoremap [fzf-p]gr :CocCommand fzf-preview.ProjectGrep 134 | xnoremap [fzf-p]gr "sy:CocCommand fzf-preview.ProjectGrep-F"=substitute(substitute(@s, '\n', '', 'g'), '/', '\\/', 'g')" 135 | nnoremap [fzf-p]t :CocCommand fzf-preview.BufferTags 136 | nnoremap [fzf-p]q :CocCommand fzf-preview.QuickFix 137 | nnoremap [fzf-p]l :CocCommand fzf-preview.LocationList 138 | -------------------------------------------------------------------------------- /config/plugin-settings.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " NERD TREE " 3 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | let NERDTreeAutoDeleteBuffer = 1 6 | let NERDTreeQuitOnOpen = 1 7 | 8 | " Close vim if nerdtree is the last buffer 9 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif 10 | 11 | let g:NERDTreeDirArrowExpandable = '+' 12 | let g:NERDTreeDirArrowCollapsible = '-' 13 | 14 | let g:NERDTreeGitStatusIndicatorMapCustom = { 15 | \ "Modified" : "M", 16 | \ "Staged" : "A", 17 | \ "Untracked" : "?", 18 | \ "Renamed" : "R", 19 | \ "Unmerged" : "U", 20 | \ "Deleted" : "D", 21 | \ "Dirty" : "✗", 22 | \ "Clean" : "✔︎", 23 | \ 'Ignored' : 'I', 24 | \ "Unknown" : "?" 25 | \ } 26 | 27 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 28 | " ROOTER " 29 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 30 | let g:rooter_patterns = ['.venv', '.git/', '.vim/'] 31 | "let g:rooter_patterns = ['tsconfig.json', 'jsconfig.json', '.venv', 'requirements.txt', '.git/', 'package.json'] 32 | "let g:rooter_targets = '/,tsconfig.json,jsconfig.json,tslint.json,.vimtags,package.json' 33 | 34 | 35 | 36 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 37 | " ALE " 38 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 39 | let g:ale_sign_warning = '⚠' 40 | let g:ale_sign_error = '✗' 41 | 42 | " Limit ALE linters 43 | let g:ale_linters = { 44 | \ 'html': ['htmlhint'], 45 | \ 'javascript': ['eslint'], 46 | \ 'typescript': ['eslint'], 47 | \} 48 | 49 | let g:ale_linter_aliases = { 50 | \ 'tsx': 'css' 51 | \} 52 | 53 | let g:ale_fixers = { 54 | \ 'javascript': ['eslint'], 55 | \ 'typescript': [] 56 | \} 57 | 58 | 59 | 60 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 61 | " VIM JSON " 62 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 63 | let g:vim_json_syntax_conceal = 0 64 | 65 | 66 | 67 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 68 | " VIM JSX " 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 70 | let g:jsx_ext_required = 0 71 | 72 | 73 | 74 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 75 | " MATCH IT " 76 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 77 | " Fix HTML 78 | autocmd FileType html let b:match_words='<:>,<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' 79 | 80 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 81 | " CTRL P " 82 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 83 | let g:ctrlp_clear_cache_on_exit = 1 84 | 85 | let g:ctrlp_user_command = 'git ls-files . --exclude-standard' 86 | 87 | 88 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 89 | " YATS " 90 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 91 | let g:yats_host_keyword = 0 92 | 93 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 94 | " ACK " 95 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 96 | if executable('ag') 97 | let g:ackprg = 'ag --vimgrep' 98 | endif 99 | 100 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 101 | " MARKDOWN " 102 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 103 | let g:markdown_fenced_languages = ['css', 'javascript', 'js=javascript', 'typescript', 'typescript.tsx=typescript', 'scss=css', 'typescriptreact=typescript'] 104 | 105 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 106 | " LSP " 107 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 108 | let g:lsp_signs_enabled = 1 " enable signs 109 | let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode 110 | 111 | if executable('typescript-language-server') 112 | au User lsp_setup call lsp#register_server({ 113 | \ 'name': 'typescript-language-server', 114 | \ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']}, 115 | \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))}, 116 | \ 'whitelist': ['typescript', 'typescript.tsx'], 117 | \ }) 118 | 119 | au User lsp_setup call lsp#register_server({ 120 | \ 'name': 'javascript-language-server', 121 | \ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']}, 122 | \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'jsconfig.json'))}, 123 | \ 'whitelist': ['javascript', 'javascript.jsx'], 124 | \ }) 125 | endif 126 | 127 | if executable('pyls') 128 | au User lsp_setup call lsp#register_server({ 129 | \ 'name': 'pyls', 130 | \ 'cmd': {server_info->['pyls']}, 131 | \ 'whitelist': ['python'], 132 | \ }) 133 | endif 134 | 135 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 136 | " COC " 137 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 138 | let g:coc_filetype_map = { 139 | \ 'sass': 'scss', 140 | \ } 141 | 142 | 143 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 144 | " VIMSPECTOR " 145 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 146 | let g:vimspector_enable_mappings = 'HUMAN' 147 | 148 | 149 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 150 | " ASYNCOMPLETE " 151 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" 152 | let g:asyncomplete_remove_duplicates = 1 153 | let g:asyncomplete_smart_completion = 1 154 | let g:asyncomplete_auto_popup = 1 155 | 156 | autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif 157 | 158 | au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({ 159 | \ 'name': 'file', 160 | \ 'whitelist': ['*'], 161 | \ 'priority': 10, 162 | \ 'completor': function('asyncomplete#sources#file#completor') 163 | \ })) 164 | 165 | "call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({ 166 | "\ 'name': 'buffer', 167 | "\ 'whitelist': ['*'], 168 | "\ 'blacklist': ['go'], 169 | "\ 'priority': -1, 170 | "\ 'completor': function('asyncomplete#sources#buffer#completor'), 171 | "\ })) 172 | -------------------------------------------------------------------------------- /config/plugins.vim: -------------------------------------------------------------------------------- 1 | call plug#begin() 2 | 3 | " --------------------------------------------------------------------- " 4 | " Better movement plugins " 5 | " --------------------------------------------------------------------- " 6 | Plug 'Lokaltog/vim-easymotion' " Fast cursor jumping in files 7 | Plug 'scrooloose/nerdtree' " Nice file explorer inside vim 8 | "Plug 'jlanzarotta/bufexplorer' " Better buffer management 9 | Plug 'Xuyuanp/nerdtree-git-plugin' " Show git changes in NERDtree 10 | Plug 'ctrlpvim/ctrlp.vim' " File finder 11 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 12 | "Plug 'mileszs/ack.vim' " Grep in vim 13 | 14 | " -------------------------------------------------------------------- " 15 | " Design changing plugins " 16 | " -------------------------------------------------------------------- " 17 | Plug 'itchyny/lightline.vim' " Nice bar 18 | "Plug 'ryanoasis/vim-devicons' " Nice file icons 19 | 20 | " -------------------------------------------------------------------- " 21 | " IDE-like stuff ( Syntax and autocomplete ) " 22 | " -------------------------------------------------------------------- " 23 | Plug 'JulesWang/css.vim' " Better CSS support (for highlight) 24 | Plug 'othree/html5.vim' " HTML5 tags 25 | Plug 'groenewege/vim-less' " Less syntax 26 | Plug 'elzr/vim-json' " Json syntax fix 27 | Plug 'pangloss/vim-javascript' " Better JS syntax & indent 28 | Plug 'chemzqm/vim-jsx-improve' 29 | Plug 'tomaskallup/yats.vim' " TS + TSX 30 | "Plug 'jasonshell/vim-svg-indent' 31 | "Plug 'PratikBhusal/vim-grip' " Grip integration 32 | Plug 'tpope/vim-markdown' 33 | "Plug 'tpope/vim-endwise' " Autoclose if etc. 34 | "Plug 'tpope/vim-fugitive' 35 | Plug 'baskerville/vim-sxhkdrc' 36 | "Plug 'digitaltoad/vim-pug' 37 | Plug 'puremourning/vimspector' 38 | 39 | if !&diff 40 | Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} 41 | endif 42 | 43 | " -------------------------------------------------------------------- " 44 | " Other general stuff " 45 | " -------------------------------------------------------------------- " 46 | Plug 'scrooloose/nerdcommenter' " Comments 47 | Plug 'tpope/vim-surround' " (o_o) 48 | Plug 'airblade/vim-rooter' 49 | Plug 'editorconfig/editorconfig-vim' 50 | "Plug 'godlygeek/tabular' " Align stuff 51 | Plug 'plytophogy/vim-virtualenv' " Virtual env 52 | Plug 'blindFS/vim-taskwarrior' " Task management 53 | 54 | call plug#end() 55 | -------------------------------------------------------------------------------- /config/ui.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""" 2 | " Custom colors 3 | """"""""""""""""""""""""""""""""""" 4 | hi TabFill ctermbg=232 ctermfg=255 5 | hi TabInactive ctermbg=235 ctermfg=255 6 | hi TabActive ctermbg=240 ctermfg=255 7 | hi TabSeparator ctermfg=232 8 | 9 | """"""""""""""""""""""""""""""""""" 10 | " Custom status line 11 | """"""""""""""""""""""""""""""""""" 12 | "set statusline=%#Normal# 13 | "set statusline+=\   14 | "set statusline+=%#TabFill# 15 | "set statusline+= %f%m 16 | "set statusline+=%#TabSeparator# 17 | "set statusline+= 18 | "set statusline+=%#Normal# 19 | "set statusline+=%= 20 | "set statusline+=%-#TabSeparator# 21 | "set statusline+= 22 | "set statusline+=%#TabFill# 23 | "set statusline+= %l:%c 24 | "set statusline+= \|  25 | "set statusline+=%{StatusLineGit()}  26 | "set statusline+=%#Normal# 27 | 28 | func GitBranch() 29 | return system("echo ${$(git symbolic-ref HEAD 2>/dev/null)##refs/heads/} | tr -d '\n'") 30 | endfunc 31 | 32 | func StatusLineGit() 33 | let l:branchname = GitBranch() 34 | return strlen(l:branchname) > 0 ? l:branchname : '[No Git]' 35 | endfunc 36 | 37 | """"""""""""""""""""""""""""""""""" 38 | " Custom tabbar 39 | """"""""""""""""""""""""""""""""""" 40 | "set tabline=%!MyTabLine() 41 | 42 | fun MyTabLine() 43 | 44 | let screen_width = &columns - 2 45 | let text_width = 0 46 | 47 | let on_screen = tabpagebuflist() 48 | 49 | let names = [] 50 | let cur = bufnr('%') 51 | for i in range(1, bufnr('$')) 52 | 53 | if !s:IsVisible(i) 54 | continue 55 | endif 56 | 57 | let name = s:TabLabel(i) 58 | 59 | let synname = 'TabInactive' 60 | if cur == i 61 | let synname = 'TabActive' 62 | elseif index(on_screen, i) >= 0 63 | let synname = 'TabFill' 64 | endif 65 | 66 | let names += [{'text': name, 'syn': synname}] 67 | let text_width += strlen(name) 68 | 69 | if cur < i - 1 70 | if text_width > screen_width 71 | let dif = text_width - screen_width 72 | let names[-1]['text'] = names[-1]['text'][: -dif] 73 | let text_width -= strlen(dif) 74 | 75 | break 76 | endif 77 | else 78 | while text_width > screen_width 79 | let dif = text_width - screen_width 80 | let first = names[0] 81 | if strlen(first['text']) <= dif 82 | call remove(names, 0) 83 | let text_width -= strlen(first['text']) 84 | else 85 | let first['text'] = first['text'][dif :] 86 | let text_width -= dif 87 | endif 88 | endwhile 89 | endif 90 | endfor 91 | 92 | let rst = '' 93 | for elt in names 94 | let rst .= '%#' . elt['syn'] . '#' . elt['text'] . '%#TabFill#' 95 | endfor 96 | 97 | return rst 98 | endfunction 99 | 100 | fun! s:IsVisible(i) 101 | if !bufexists(a:i) || !buflisted(a:i) 102 | return 0 103 | endif 104 | 105 | if getbufvar(a:i, 'current_syntax') == 'qf' 106 | return 0 107 | endif 108 | 109 | return 1 110 | endfunction 111 | 112 | fun! s:TabLabel(i) 113 | let mod = getbufvar(a:i, "&mod") 114 | let text = "" 115 | 116 | if mod == 1 117 | let text = "[+]" 118 | endif 119 | 120 | return s:BufLabel(a:i) . text 121 | endfunction 122 | 123 | fun! s:BufLabel(i) 124 | let path = bufname(a:i) 125 | if path == "" 126 | return ' [No Name] ' 127 | endif 128 | 129 | let path = s:PathForHuman(path) 130 | return substitute(' {path} ', '\V{path}', path, 'g') 131 | 132 | endfunction 133 | 134 | fun! s:PathForHuman(p) 135 | let p = a:p 136 | let p = simplify(p) 137 | let p = substitute(p, '\', '/', 'g') 138 | 139 | let p = substitute(p, '^\V' . escape( $HOME, '\' ), '~', '') 140 | 141 | let p = pathshorten(p) 142 | return p 143 | endfunction 144 | -------------------------------------------------------------------------------- /custom.zsh-theme: -------------------------------------------------------------------------------- 1 | # Customized theme 2 | 3 | setopt prompt_subst 4 | 5 | () { 6 | 7 | local PR_USER PR_USER_OP PR_PROMPT PR_HOST 8 | 9 | # Check the UID 10 | if [[ $UID -ne 0 ]]; then # normal user 11 | PR_USER='%F{green}%n%f' 12 | PR_USER_OP='%F{green}%#%f' 13 | PR_PROMPT='%F{white}➤ %f' 14 | else # root 15 | PR_USER='%F{red}%n%f' 16 | PR_USER_OP='%F{red}%#%f' 17 | PR_PROMPT='%F{red}➤ %f' 18 | fi 19 | 20 | # Check if we are on SSH or not 21 | if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then 22 | PR_HOST='%F{red}%m%f' # SSH 23 | else 24 | PR_HOST='%F{green}Macous%f' # no SSH 25 | fi 26 | 27 | 28 | local return_code="%(?..%F{red}%? ↵%f)" 29 | 30 | local user_host="${PR_USER}%F{cyan}@${PR_HOST}" 31 | local current_dir="%B%F{blue}%2~%f%b" 32 | local git_branch='$(git_prompt_info)' 33 | 34 | PROMPT="${user_host} ${current_dir} ${git_branch}$PR_PROMPT " 35 | RPROMPT="" 36 | 37 | ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹" 38 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %f" 39 | 40 | } 41 | -------------------------------------------------------------------------------- /iTermProfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "Use Non-ASCII Font" : false, 3 | "Tags" : [ 4 | 5 | ], 6 | "Ansi 12 Color" : { 7 | "Red Component" : 0.19195556640625, 8 | "Color Space" : "sRGB", 9 | "Blue Component" : 1, 10 | "Alpha Component" : 1, 11 | "Green Component" : 0.36333950236439705 12 | }, 13 | "Ansi 1 Color" : { 14 | "Red Component" : 0.8922882080078125, 15 | "Color Space" : "sRGB", 16 | "Blue Component" : 0, 17 | "Alpha Component" : 1, 18 | "Green Component" : 0 19 | }, 20 | "Normal Font" : "SauceCodeProNerdFontC-Regular 18", 21 | "Bold Color" : { 22 | "Red Component" : 0.99999600648880005, 23 | "Color Space" : "sRGB", 24 | "Blue Component" : 1, 25 | "Alpha Component" : 1, 26 | "Green Component" : 1 27 | }, 28 | "Ansi 2 Color" : { 29 | "Red Component" : 0, 30 | "Color Space" : "sRGB", 31 | "Blue Component" : 0, 32 | "Alpha Component" : 1, 33 | "Green Component" : 0.93333333333333335 34 | }, 35 | "Ansi 3 Color" : { 36 | "Red Component" : 0.93389892578125, 37 | "Color Space" : "sRGB", 38 | "Blue Component" : 0, 39 | "Alpha Component" : 1, 40 | "Green Component" : 0.4742740485817194 41 | }, 42 | "Ansi 5 Color" : { 43 | "Red Component" : 1, 44 | "Color Space" : "sRGB", 45 | "Blue Component" : 0, 46 | "Alpha Component" : 1, 47 | "Green Component" : 0.325927734375 48 | }, 49 | "Rows" : 25, 50 | "Default Bookmark" : "No", 51 | "Cursor Guide Color" : { 52 | "Red Component" : 0.70213186740875244, 53 | "Color Space" : "sRGB", 54 | "Blue Component" : 1, 55 | "Alpha Component" : 0.25, 56 | "Green Component" : 0.9268307089805603 57 | }, 58 | "Non-ASCII Anti Aliased" : true, 59 | "Use Bright Bold" : false, 60 | "Show Mark Indicators" : false, 61 | "Ansi 10 Color" : { 62 | "Red Component" : 0, 63 | "Color Space" : "sRGB", 64 | "Blue Component" : 0, 65 | "Alpha Component" : 1, 66 | "Green Component" : 0.85098040103912354 67 | }, 68 | "Ambiguous Double Width" : false, 69 | "Jobs to Ignore" : [ 70 | "rlogin", 71 | "ssh", 72 | "slogin", 73 | "telnet" 74 | ], 75 | "Ansi 15 Color" : { 76 | "Red Component" : 1, 77 | "Color Space" : "sRGB", 78 | "Blue Component" : 1, 79 | "Alpha Component" : 1, 80 | "Green Component" : 1 81 | }, 82 | "Foreground Color" : { 83 | "Red Component" : 1, 84 | "Color Space" : "sRGB", 85 | "Blue Component" : 0.99997633695602417, 86 | "Alpha Component" : 1, 87 | "Green Component" : 0.99997633695602417 88 | }, 89 | "Working Directory" : "\/Users\/tomaskallup", 90 | "Blinking Cursor" : false, 91 | "Disable Window Resizing" : true, 92 | "Sync Title" : false, 93 | "Prompt Before Closing 2" : false, 94 | "BM Growl" : false, 95 | "Command" : "", 96 | "Description" : "Default", 97 | "Space" : 0, 98 | "Mouse Reporting" : true, 99 | "Screen" : -1, 100 | "Selection Color" : { 101 | "Red Component" : 0, 102 | "Color Space" : "sRGB", 103 | "Blue Component" : 0.49803921580314636, 104 | "Alpha Component" : 1, 105 | "Green Component" : 0.015686275437474251 106 | }, 107 | "Only The Default BG Color Uses Transparency" : true, 108 | "Columns" : 80, 109 | "Idle Code" : 0, 110 | "Ansi 13 Color" : { 111 | "Red Component" : 1, 112 | "Color Space" : "sRGB", 113 | "Blue Component" : 0, 114 | "Alpha Component" : 1, 115 | "Green Component" : 0 116 | }, 117 | "Custom Command" : "No", 118 | "ASCII Anti Aliased" : true, 119 | "Non Ascii Font" : "Monaco 12", 120 | "Vertical Spacing" : 1.0010589231927711, 121 | "Use Bold Font" : true, 122 | "Option Key Sends" : 0, 123 | "Selected Text Color" : { 124 | "Red Component" : 1, 125 | "Color Space" : "sRGB", 126 | "Blue Component" : 0, 127 | "Alpha Component" : 1, 128 | "Green Component" : 0.59527587890625 129 | }, 130 | "Background Color" : { 131 | "Red Component" : 0, 132 | "Color Space" : "sRGB", 133 | "Blue Component" : 0, 134 | "Alpha Component" : 1, 135 | "Green Component" : 0 136 | }, 137 | "Character Encoding" : 4, 138 | "Ansi 11 Color" : { 139 | "Red Component" : 1, 140 | "Color Space" : "sRGB", 141 | "Blue Component" : 0, 142 | "Alpha Component" : 1, 143 | "Green Component" : 0.50840336134453779 144 | }, 145 | "Use Italic Font" : true, 146 | "Unlimited Scrollback" : false, 147 | "Keyboard Map" : { 148 | "0xf700-0x260000" : { 149 | "Action" : 10, 150 | "Text" : "[1;6A" 151 | }, 152 | "0x37-0x40000" : { 153 | "Action" : 11, 154 | "Text" : "0x1f" 155 | }, 156 | "0x32-0x40000" : { 157 | "Action" : 11, 158 | "Text" : "0x00" 159 | }, 160 | "0xf709-0x20000" : { 161 | "Action" : 10, 162 | "Text" : "[17;2~" 163 | }, 164 | "0xf70c-0x20000" : { 165 | "Action" : 10, 166 | "Text" : "[20;2~" 167 | }, 168 | "0xf729-0x20000" : { 169 | "Action" : 10, 170 | "Text" : "[1;2H" 171 | }, 172 | "0xf72b-0x40000" : { 173 | "Action" : 10, 174 | "Text" : "[1;5F" 175 | }, 176 | "0xf705-0x20000" : { 177 | "Action" : 10, 178 | "Text" : "[1;2Q" 179 | }, 180 | "0xf703-0x260000" : { 181 | "Action" : 10, 182 | "Text" : "[1;6C" 183 | }, 184 | "0xf700-0x220000" : { 185 | "Action" : 10, 186 | "Text" : "[1;2A" 187 | }, 188 | "0xf701-0x280000" : { 189 | "Action" : 11, 190 | "Text" : "0x1b 0x1b 0x5b 0x42" 191 | }, 192 | "0x38-0x40000" : { 193 | "Action" : 11, 194 | "Text" : "0x7f" 195 | }, 196 | "0x33-0x40000" : { 197 | "Action" : 11, 198 | "Text" : "0x1b" 199 | }, 200 | "0xf703-0x220000" : { 201 | "Action" : 10, 202 | "Text" : "[1;2C" 203 | }, 204 | "0xf701-0x240000" : { 205 | "Action" : 10, 206 | "Text" : "[1;5B" 207 | }, 208 | "0xf70d-0x20000" : { 209 | "Action" : 10, 210 | "Text" : "[21;2~" 211 | }, 212 | "0xf702-0x260000" : { 213 | "Action" : 10, 214 | "Text" : "[1;6D" 215 | }, 216 | "0xf729-0x40000" : { 217 | "Action" : 10, 218 | "Text" : "[1;5H" 219 | }, 220 | "0xf706-0x20000" : { 221 | "Action" : 10, 222 | "Text" : "[1;2R" 223 | }, 224 | "0x34-0x40000" : { 225 | "Action" : 11, 226 | "Text" : "0x1c" 227 | }, 228 | "0xf700-0x280000" : { 229 | "Action" : 11, 230 | "Text" : "0x1b 0x1b 0x5b 0x41" 231 | }, 232 | "0x2d-0x40000" : { 233 | "Action" : 11, 234 | "Text" : "0x1f" 235 | }, 236 | "0xf70e-0x20000" : { 237 | "Action" : 10, 238 | "Text" : "[23;2~" 239 | }, 240 | "0xf702-0x220000" : { 241 | "Action" : 10, 242 | "Text" : "[1;2D" 243 | }, 244 | "0xf703-0x280000" : { 245 | "Action" : 11, 246 | "Text" : "0x1b 0x1b 0x5b 0x43" 247 | }, 248 | "0xf700-0x240000" : { 249 | "Action" : 10, 250 | "Text" : "[1;5A" 251 | }, 252 | "0xf707-0x20000" : { 253 | "Action" : 10, 254 | "Text" : "[1;2S" 255 | }, 256 | "0xf70a-0x20000" : { 257 | "Action" : 10, 258 | "Text" : "[18;2~" 259 | }, 260 | "0x35-0x40000" : { 261 | "Action" : 11, 262 | "Text" : "0x1d" 263 | }, 264 | "0xf70f-0x20000" : { 265 | "Action" : 10, 266 | "Text" : "[24;2~" 267 | }, 268 | "0xf703-0x240000" : { 269 | "Action" : 10, 270 | "Text" : "[1;5C" 271 | }, 272 | "0xf701-0x260000" : { 273 | "Action" : 10, 274 | "Text" : "[1;6B" 275 | }, 276 | "0xf702-0x280000" : { 277 | "Action" : 11, 278 | "Text" : "0x1b 0x1b 0x5b 0x44" 279 | }, 280 | "0xf72b-0x20000" : { 281 | "Action" : 10, 282 | "Text" : "[1;2F" 283 | }, 284 | "0x36-0x40000" : { 285 | "Action" : 11, 286 | "Text" : "0x1e" 287 | }, 288 | "0xf708-0x20000" : { 289 | "Action" : 10, 290 | "Text" : "[15;2~" 291 | }, 292 | "0xf701-0x220000" : { 293 | "Action" : 10, 294 | "Text" : "[1;2B" 295 | }, 296 | "0xf70b-0x20000" : { 297 | "Action" : 10, 298 | "Text" : "[19;2~" 299 | }, 300 | "0xf702-0x240000" : { 301 | "Action" : 10, 302 | "Text" : "[1;5D" 303 | }, 304 | "0xf704-0x20000" : { 305 | "Action" : 10, 306 | "Text" : "[1;2P" 307 | } 308 | }, 309 | "Window Type" : 12, 310 | "Blur Radius" : 10.44909779505076, 311 | "Cursor Type" : 0, 312 | "Background Image Location" : "", 313 | "Blur" : true, 314 | "Badge Color" : { 315 | "Red Component" : 1, 316 | "Color Space" : "sRGB", 317 | "Blue Component" : 0, 318 | "Alpha Component" : 0.5, 319 | "Green Component" : 0.1491314172744751 320 | }, 321 | "Allow Title Setting" : false, 322 | "Scrollback Lines" : 1000, 323 | "Semantic History" : { 324 | "text" : "echo vim \\1 +\\2", 325 | "action" : "coprocess", 326 | "editor" : "com.sublimetext.3" 327 | }, 328 | "Send Code When Idle" : false, 329 | "Close Sessions On End" : true, 330 | "Terminal Type" : "xterm-256color", 331 | "Visual Bell" : false, 332 | "Flashing Bell" : false, 333 | "Silence Bell" : true, 334 | "Ansi 14 Color" : { 335 | "Red Component" : 0.037941642105579376, 336 | "Color Space" : "sRGB", 337 | "Blue Component" : 0.863983154296875, 338 | "Alpha Component" : 1, 339 | "Green Component" : 0.83123695850372314 340 | }, 341 | "Name" : "Default", 342 | "Cursor Text Color" : { 343 | "Red Component" : 0.99999600648880005, 344 | "Color Space" : "sRGB", 345 | "Blue Component" : 1, 346 | "Alpha Component" : 1, 347 | "Green Component" : 1 348 | }, 349 | "Shortcut" : "", 350 | "Cursor Color" : { 351 | "Red Component" : 0, 352 | "Color Space" : "sRGB", 353 | "Blue Component" : 0.05828857421875, 354 | "Alpha Component" : 1, 355 | "Green Component" : 1 356 | }, 357 | "Ansi 0 Color" : { 358 | "Red Component" : 0, 359 | "Color Space" : "sRGB", 360 | "Blue Component" : 0, 361 | "Alpha Component" : 1, 362 | "Green Component" : 0 363 | }, 364 | "Transparency" : 0.31110604378172591, 365 | "Guid" : "93F188F8-ED80-4C76-8F54-696B7989A6C7", 366 | "Horizontal Spacing" : 1, 367 | "Ansi 4 Color" : { 368 | "Red Component" : 0.055873595178127289, 369 | "Color Space" : "sRGB", 370 | "Blue Component" : 1, 371 | "Alpha Component" : 1, 372 | "Green Component" : 0.036346435546875 373 | }, 374 | "Link Color" : { 375 | "Red Component" : 0, 376 | "Color Space" : "sRGB", 377 | "Blue Component" : 0.73423302173614502, 378 | "Alpha Component" : 1, 379 | "Green Component" : 0.35916060209274292 380 | }, 381 | "Ansi 6 Color" : { 382 | "Red Component" : 0, 383 | "Color Space" : "sRGB", 384 | "Blue Component" : 0.69803923368453979, 385 | "Alpha Component" : 1, 386 | "Green Component" : 0.63529413938522339 387 | }, 388 | "Ansi 7 Color" : { 389 | "Red Component" : 0.90460205078125, 390 | "Color Space" : "sRGB", 391 | "Blue Component" : 0.90460205078125, 392 | "Alpha Component" : 1, 393 | "Green Component" : 0.90460205078125 394 | }, 395 | "Ansi 8 Color" : { 396 | "Red Component" : 0.16302490234375, 397 | "Color Space" : "sRGB", 398 | "Blue Component" : 0.16302490234375, 399 | "Alpha Component" : 1, 400 | "Green Component" : 0.16302490234375 401 | }, 402 | "Ansi 9 Color" : { 403 | "Red Component" : 1, 404 | "Color Space" : "sRGB", 405 | "Blue Component" : 0, 406 | "Alpha Component" : 1, 407 | "Green Component" : 0 408 | }, 409 | "Custom Directory" : "Recycle", 410 | "Right Option Key Sends" : 0 411 | } 412 | -------------------------------------------------------------------------------- /install-neovim.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 4 | 5 | mkdir -p ~/.config/ 6 | ln -s $DIR/nvim ~/.config/nvim 7 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 4 | 5 | mkdir ~/.vim 6 | ln -s $DIR/.vimrc ~/.vimrc 7 | ln -s $DIR/config ~/.vim/config 8 | ln -s $DIR/.gitconfig ~/.gitconfig 9 | ln -s $DIR/.zshrc ~/.zshrc 10 | ln -s $DIR/todo ~/.todo 11 | -------------------------------------------------------------------------------- /mongod.conf: -------------------------------------------------------------------------------- 1 | systemLog: 2 | destination: file 3 | path: /usr/local/var/log/mongodb/mongo.log 4 | logAppend: true 5 | storage: 6 | dbPath: /data/db 7 | net: 8 | bindIp: 127.0.0.1 9 | -------------------------------------------------------------------------------- /nvim/base.vim: -------------------------------------------------------------------------------- 1 | let g:python_recommended_style = 0 2 | filetype plugin on 3 | 4 | set showcmd 5 | set showmode 6 | set number 7 | set relativenumber 8 | set hidden 9 | set breakindent 10 | set hlsearch 11 | set incsearch 12 | set autoread 13 | set tabstop=2 14 | set expandtab 15 | set shiftwidth=2 16 | set smarttab 17 | set showmatch 18 | set foldenable 19 | set foldmethod=manual 20 | set wrap 21 | set linebreak 22 | set formatoptions+=l 23 | set formatoptions-=t 24 | set virtualedit=onemore 25 | set ignorecase 26 | set smartcase 27 | set splitbelow 28 | set splitright 29 | set updatetime=500 30 | set title 31 | set titleold="st" 32 | set list 33 | set listchars="tab:> ,trail:-,extends:#,nbsp:+" 34 | set backupdir=~/.vim/SWP 35 | set directory=~/.vim/SWP 36 | set writebackup 37 | set backupcopy=yes 38 | set undofile 39 | set undodir=$HOME/.vim/undo 40 | set undolevels=150 41 | set scrolloff=5 42 | set wildignore+=**/node_modules/** 43 | set gdefault 44 | set wildmenu 45 | set wildmode=longest:full,full 46 | set grepprg=ag\ --vimgrep 47 | set spelllang=en,cs 48 | set diffopt=internal,filler,closeoff,algorithm:histogram,linematch:50 49 | set laststatus=3 50 | 51 | " Set completeopt to have a better completion experience 52 | "set completeopt=menuone,noinsert,noselect,preview 53 | set completeopt=menuone,noselect 54 | 55 | " Avoid showing message extra message when using completion 56 | set shortmess+=c 57 | 58 | " Highlight from start of file 59 | autocmd BufEnter * :syntax sync fromstart 60 | 61 | set clipboard+=unnamedplus 62 | set fileencoding=utf-8 63 | 64 | let g:html_indent_inctags = "html,body,head,tbody,div" 65 | 66 | " Remember cursor pos 67 | autocmd BufReadPost * 68 | \ if line("'\"") > 1 && line("'\"") <= line("$") | 69 | \ exe "normal! g`\"" | 70 | \ endif 71 | 72 | function! SynStack() 73 | if !exists("*synstack") 74 | return 75 | endif 76 | echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') 77 | endfunc 78 | 79 | augroup LocalConfig 80 | autocmd VimEnter,BufEnter * lua require'localconfig'.check() 81 | augroup END 82 | 83 | " Make sure python uses 4 spaces for tab 84 | autocmd Filetype python setlocal ts=4 sw=4 expandtab 85 | 86 | let g:vimsyn_embed = "lPr" 87 | -------------------------------------------------------------------------------- /nvim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "coc.preferences.enableFloatHighlight": true, 3 | "coc.preferences.hoverTarget": "float", 4 | "codeLens.enable": true, 5 | "codeLens.separator": "‣", 6 | "diagnostic.checkCurrentLine": false, 7 | "diagnostic.displayByAle": false, 8 | "diagnostic.maxWindowHeight": 20, 9 | "diagnostic.messageTarget": "float", 10 | "diagnostic.refreshAfterSave": true, 11 | "diagnostic.refreshOnInsertMode": true, 12 | "eslint.enable": true, 13 | "eslint.filetypes": [ 14 | "javascript", 15 | "javascriptreact", 16 | "javascript.jsx", 17 | "typescript", 18 | "typescriptreact", 19 | "typescript.tsx" 20 | ], 21 | "prettier.eslintIntegration": false, 22 | "prettier.semi": true, 23 | "prettier.singleQuote": true, 24 | "prettier.trailingComma": "all", 25 | "signature.enable": true, 26 | "signature.target": "float", 27 | "suggest.enablePreview": true, 28 | "typescript.implementationsCodeLens.enable": true, 29 | "typescript.referencesCodeLens.enable": true, 30 | "languageserver": { 31 | "ccls": { 32 | "command": "ccls", 33 | "filetypes": ["c", "cpp", "objc", "objcpp"], 34 | "rootPatterns": [ 35 | ".ccls", 36 | "compile_commands.json", 37 | ".vim/", 38 | ".git/", 39 | ".hg/" 40 | ], 41 | "initializationOptions": { 42 | "cache": { 43 | "directory": "/tmp/ccls" 44 | } 45 | } 46 | } 47 | }, 48 | "python.linting.lintOnSave": true, 49 | "python.jediEnabled": false, 50 | "css.validate": false, 51 | "scss.validate": true, 52 | "explorer.icon.enableNerdfont": true, 53 | "explorer.filename.colored.enable": false, 54 | "git.addGBlameToVirtualText": false 55 | } 56 | -------------------------------------------------------------------------------- /nvim/colors/custom.vim: -------------------------------------------------------------------------------- 1 | hi SpecialKey term=bold ctermfg=4 guifg=Blue 2 | hi NonText term=bold ctermfg=12 gui=bold guifg=Blue 3 | hi Directory term=bold ctermfg=3 guifg=#5fff87 4 | hi ErrorMsg term=standout ctermfg=15 ctermbg=1 guifg=White guibg=Red 5 | hi IncSearch term=reverse cterm=reverse gui=reverse 6 | hi Search term=reverse ctermfg=0 ctermbg=2 guibg=Yellow 7 | hi MoreMsg term=bold ctermfg=2 gui=bold guifg=SeaGreen 8 | hi ModeMsg term=bold cterm=bold gui=bold 9 | hi LineNr term=underline ctermfg=130 guifg=Brown 10 | hi CursorLineNr term=bold cterm=bold ctermfg=1 gui=bold guifg=Brown 11 | hi Question term=standout ctermfg=2 gui=bold guifg=SeaGreen 12 | hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold,reverse 13 | hi StatusLineNC term=reverse cterm=reverse gui=reverse 14 | hi VertSplit term=reverse cterm=reverse gui=reverse 15 | hi Title term=bold ctermfg=5 gui=bold guifg=Magenta 16 | hi Visual term=reverse ctermbg=7 guibg=LightGrey 17 | hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline 18 | hi WarningMsg term=standout cterm=bold ctermfg=1 ctermbg=16 guifg=Red 19 | hi WildMenu term=standout ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow 20 | hi Folded term=standout ctermfg=4 ctermbg=248 guifg=DarkBlue guibg=LightGrey 21 | hi FoldColumn term=standout ctermfg=4 ctermbg=248 guifg=DarkBlue guibg=Grey 22 | hi DiffAdd cterm=bold ctermfg=NONE ctermbg=22 23 | hi DiffDelete cterm=bold ctermfg=NONE ctermbg=52 24 | hi DiffChange cterm=bold ctermfg=NONE ctermbg=238 25 | hi DiffText cterm=bold ctermfg=NONE ctermbg=28 26 | hi SignColumn term=standout ctermfg=4 ctermbg=8 guifg=DarkBlue guibg=Grey 27 | hi Conceal ctermfg=7 ctermbg=242 guifg=LightGrey guibg=DarkGrey 28 | hi SpellBad term=reverse ctermfg=15 ctermbg=9 gui=undercurl guisp=Red 29 | hi SpellCap term=reverse ctermbg=81 gui=undercurl guisp=Blue 30 | hi SpellRare term=reverse ctermbg=225 gui=undercurl guisp=Magenta 31 | hi SpellLocal term=underline ctermbg=14 gui=undercurl guisp=DarkCyan 32 | hi Pmenu ctermfg=0 ctermbg=225 guibg=LightMagenta 33 | hi PmenuSel ctermfg=0 ctermbg=7 guibg=Grey 34 | hi PmenuSbar ctermbg=248 guibg=Grey 35 | hi PmenuThumb ctermbg=0 guibg=Black 36 | hi TabLine term=underline cterm=underline ctermfg=0 ctermbg=7 gui=underline guibg=LightGrey 37 | hi TabLineSel term=bold cterm=bold gui=bold 38 | hi TabLineFill term=reverse cterm=reverse gui=reverse 39 | hi CursorColumn term=reverse ctermbg=7 guibg=Grey90 40 | hi CursorLine term=underline cterm=underline gui=underline 41 | hi ColorColumn term=reverse ctermbg=224 guibg=LightRed 42 | hi StatusLineTerm term=bold,reverse cterm=bold ctermfg=15 ctermbg=2 gui=bold guifg=bg guibg=DarkGreen 43 | hi StatusLineTermNC term=reverse ctermfg=15 ctermbg=2 guifg=bg guibg=DarkGreen 44 | hi MatchParen term=reverse ctermbg=14 guibg=Cyan 45 | hi ToolbarLine term=underline ctermbg=7 guibg=LightGrey 46 | hi ToolbarButton cterm=bold ctermfg=15 ctermbg=242 gui=bold guifg=White guibg=Grey40 47 | hi Comment term=bold ctermfg=4 guifg=Blue 48 | hi Constant term=underline ctermfg=1 guifg=Magenta 49 | hi Special term=bold ctermfg=11 guifg=SlateBlue 50 | hi Identifier term=underline cterm=None ctermfg=5 guifg=DarkCyan 51 | hi Statement term=bold ctermfg=130 gui=bold guifg=Brown 52 | hi PreProc term=underline ctermfg=6 guifg=Purple 53 | hi Type term=underline ctermfg=10 gui=bold guifg=SeaGreen 54 | hi Underlined term=underline cterm=underline ctermfg=5 gui=underline guifg=SlateBlue 55 | hi Ignore ctermfg=15 guifg=bg 56 | hi Error term=reverse ctermfg=15 ctermbg=9 guifg=White guibg=Red 57 | hi Todo term=standout ctermfg=0 ctermbg=11 guifg=Blue guibg=Yellow 58 | 59 | hi link TSFunction Normal 60 | hi link TSConstructor Normal 61 | -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | set runtimepath^=~/.vim runtimepath+=~/.vim/after 2 | let &packpath = &runtimepath 3 | 4 | let g:custom_path = '~/.config/nvim/' 5 | 6 | func LoadConfig(name) 7 | exec 'source' g:custom_path . a:name . '.vim' 8 | endfunc 9 | 10 | exec 'luafile' expand(g:custom_path . 'lua/plugins.lua') 11 | 12 | call LoadConfig('base') 13 | call LoadConfig('keymap') 14 | 15 | set nocompatible 16 | 17 | "colorscheme arcolors 18 | set termguicolors 19 | set inccommand=split 20 | 21 | let g:python_host_prg = '/usr/local/bin/python' 22 | let g:python3_host_prg = '/usr/local/bin/python3' 23 | -------------------------------------------------------------------------------- /nvim/keymap.vim: -------------------------------------------------------------------------------- 1 | " Change leader key to "space" 2 | let mapleader="\" 3 | 4 | " Remove highlights from search with f 5 | map s :noh 6 | 7 | map w :w 8 | map q :q 9 | map x :x 10 | nnoremap j j 11 | nnoremap k k 12 | nnoremap l l 13 | nnoremap h h 14 | nnoremap J J 15 | nnoremap K K 16 | nnoremap L L 17 | nnoremap H H 18 | nnoremap W W 19 | 20 | if &diff 21 | map q :qall 22 | endif 23 | 24 | " Escaping insert/visual modes 25 | ino jk 26 | ino kj 27 | vno v 28 | tno jk 29 | tno kj 30 | 31 | " Yank whole file 32 | map y ggyG`` 33 | 34 | " Go back 35 | nmap gb :bp 36 | " Go next 37 | nmap gn :next 38 | 39 | "{{{ CHAD Tree 40 | nmap m CHADopen 41 | "}}} 42 | 43 | "{{{ Buffer managament 44 | nmap b [buffer] 45 | 46 | map [buffer]d :Bdelete 47 | map [buffer]D :bd 48 | map [buffer]n :bn 49 | map [buffer]p :bp 50 | "}}} 51 | 52 | map C [cf] 53 | map [cf]n :cnext 54 | map [cf]p :cprevious 55 | 56 | imap 57 | -------------------------------------------------------------------------------- /nvim/lua/efm/autopep8.lua: -------------------------------------------------------------------------------- 1 | return { 2 | formatCommand = "autopep8 -", 3 | formatStdin = true 4 | } 5 | -------------------------------------------------------------------------------- /nvim/lua/efm/eslint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}", 3 | lintIgnoreExitCode = true, 4 | lintStdin = true, 5 | lintFormats = {"%f:%l:%c: %m"}, 6 | } 7 | -------------------------------------------------------------------------------- /nvim/lua/efm/luafmt.lua: -------------------------------------------------------------------------------- 1 | return { 2 | formatCommand = "lua-format -i", 3 | formatStdin = true 4 | } 5 | -------------------------------------------------------------------------------- /nvim/lua/efm/prettier.lua: -------------------------------------------------------------------------------- 1 | return { 2 | formatCommand = "./node_modules/.bin/prettier --stdin-filepath ${INPUT}", 3 | formatStdin = true 4 | } 5 | -------------------------------------------------------------------------------- /nvim/lua/efm/rustfmt.lua: -------------------------------------------------------------------------------- 1 | return { 2 | formatCommand = "rustfmt", 3 | formatStdin = true 4 | } 5 | -------------------------------------------------------------------------------- /nvim/lua/localconfig.lua: -------------------------------------------------------------------------------- 1 | local loadedConfigs = {} 2 | 3 | local M = {} 4 | 5 | M.check = function() 6 | local pwd = vim.fn.getcwd() 7 | 8 | if pwd == nil then return end 9 | 10 | local configDirPath = pwd .. '/.nvim' 11 | local configDir = vim.loop.fs_stat(configDirPath) 12 | 13 | if configDir ~= nil then 14 | local configPath = configDirPath .. '/init.lua' 15 | local config = vim.loop.fs_stat(configPath) 16 | 17 | if config ~= nil then 18 | if not loadedConfigs[configPath] then 19 | print('Loading config', configPath) 20 | vim.cmd('luafile ' .. configPath) 21 | loadedConfigs[configPath] = true 22 | end 23 | end 24 | end 25 | end 26 | 27 | return M 28 | -------------------------------------------------------------------------------- /nvim/lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local packer = require("packer") 2 | local use = packer.use 3 | return packer.startup(function() 4 | use("wbthomason/packer.nvim") 5 | 6 | -- =======================================-- 7 | -- Movement & editation plugins -- 8 | -- =======================================-- 9 | use("tpope/vim-repeat") -- Use `.` to repeat surround and other commands 10 | use("tpope/vim-surround") -- (o_o) -> ca([ -> [o_o] 11 | use("jiangmiao/auto-pairs") -- Matching parens, quotes etc. 12 | use({ -- Add matching HTML tag 13 | "windwp/nvim-ts-autotag", 14 | config = function() 15 | require("nvim-ts-autotag").setup() 16 | end, 17 | ft = { "javascript", "javascriptreact", "typescript", "typescriptreact" }, 18 | }) 19 | use({ 20 | "numToStr/Comment.nvim", 21 | config = function() 22 | require("plugins.comment-nvim") 23 | end, 24 | }) 25 | 26 | -- =======================================-- 27 | -- UI plugins -- 28 | -- =======================================-- 29 | use({ -- Nice bar 30 | "hoob3rt/lualine.nvim", 31 | config = function() 32 | require("plugins.nvim-lualine") 33 | end, 34 | }) 35 | -- use 'tomaskallup/arcolors' -- Colorscheme 36 | use({ -- Colorscheme 37 | "marko-cerovac/material.nvim", 38 | branch = "main", 39 | config = function() 40 | vim.g.material_style = "deep ocean" 41 | require("material").setup({ 42 | contrast = { 43 | sidebars = true, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree ) 44 | floating_windows = true, -- Enable contrast for floating windows 45 | line_numbers = true, -- Enable contrast background for line numbers 46 | sign_column = true, -- Enable contrast background the sign column 47 | cursor_line = false, -- Enable darker background for the cursor line 48 | non_current_windows = false, -- Enable darker background for non-current windows 49 | popup_menu = true, -- Enable lighter background for the popup menu 50 | }, 51 | 52 | contrast_filetypes = { 53 | "terminal", -- Darker terminal background 54 | "term", -- Darker terminal background 55 | "packer", -- Darker packer background 56 | "qf", -- Darker qf list background 57 | }, 58 | 59 | disable = { 60 | term_colors = true, 61 | borders = false, 62 | colored_cursor = true, 63 | }, 64 | 65 | custom_highlights = { 66 | DiffAdd = { bg = "#002500" }, 67 | DiffDelete = { bg = "#250000" }, 68 | DiffChange = { bg = "None" }, 69 | DiffText = { bg = "None", fg = "#999900" }, 70 | NvimTreeNormal = { fg = "#A6ACCD" }, 71 | NeomakeVirtualtextErrorDefault = { fg = "#AF111A" }, 72 | FloatTitle = { fg = "#a6accd", bg = "#090b10" }, 73 | }, 74 | }) 75 | vim.cmd([[colorscheme material]]) 76 | end, 77 | }) 78 | use("kyazdani42/nvim-web-devicons") -- Icons 79 | use({ -- For icons in completion 80 | "onsails/lspkind-nvim", 81 | -- Config is done in cmp configuration 82 | -- config = function() require 'plugins.lspkind-nvim' end 83 | }) 84 | use({ -- Show git changes in signcolumn 85 | "lewis6991/gitsigns.nvim", 86 | branch = "main", 87 | config = function() 88 | require("plugins.gitsigns") 89 | end, 90 | }) 91 | use("kevinhwang91/nvim-bqf") -- Enhanced quickfix 92 | 93 | use({ -- Terminal enhancements 94 | "akinsho/toggleterm.nvim", 95 | branch = "main", 96 | config = function() 97 | require("plugins.toggleterm") 98 | end, 99 | }) 100 | 101 | use({ -- Overall UI enhancements 102 | "stevearc/dressing.nvim", 103 | config = function() 104 | require("plugins.dressing") 105 | end, 106 | }) 107 | 108 | use({ -- Notifications 109 | "rcarriga/nvim-notify", 110 | config = function() 111 | require("notify").setup({ max_width = 400, background_colour = "#0f111a" }) 112 | vim.notify = require("notify") 113 | end, 114 | }) 115 | 116 | -- =======================================-- 117 | -- Syntax plugins -- 118 | -- =======================================-- 119 | use({ -- Ensure ansi color codes are handled 120 | "powerman/vim-plugin-AnsiEsc", 121 | config = function() 122 | vim.g.no_cecutil_maps = 1 123 | end, 124 | }) 125 | use({ -- Unified highlight for all filetypes 126 | "nvim-treesitter/nvim-treesitter", 127 | run = ":TSUpdate", 128 | config = function() 129 | require("plugins.treesitter") 130 | end, 131 | }) 132 | -- use 'nvim-treesitter/playground' 133 | use({ "aklt/plantuml-syntax" }) -- Plant uml syntax 134 | use({ -- Show colors in neovim (Red, Green, Blue, etc.) 135 | "norcalli/nvim-colorizer.lua", 136 | config = function() 137 | require("colorizer").setup() 138 | end, 139 | }) 140 | use("pantharshit00/vim-prisma") 141 | use("chr4/nginx.vim") 142 | 143 | -- =======================================-- 144 | -- IDE (completion, debugging) -- 145 | -- =======================================-- 146 | -- Debugging for javascript/typescript 147 | use({ 148 | "mxsdev/nvim-dap-vscode-js", 149 | }) 150 | use({ 151 | "microsoft/vscode-js-debug", 152 | opt = true, 153 | run = "npm ci --legacy-peer-deps && npx gulp vsDebugServerBundle && rm -rf out && mv dist out", 154 | }) 155 | use({ 156 | "mfussenegger/nvim-dap", 157 | config = function() 158 | require("plugins.nvim-dap") 159 | end, 160 | }) 161 | use("plytophogy/vim-virtualenv") -- Virtual env 162 | 163 | use({ 164 | "airblade/vim-rooter", 165 | config = function() -- Automatically set pwd when opening a file 166 | vim.g.rooter_patterns = { ".venv", ".git/", ".nvim/" } 167 | end, 168 | }) 169 | 170 | use({ -- LSP configurations for builtin LSP client 171 | "neovim/nvim-lspconfig", 172 | config = function() 173 | require("plugins.nvim-lspconfig") 174 | end, 175 | }) 176 | use("L3MON4D3/LuaSnip") -- Snippets plugin 177 | use({ -- Completion 178 | "hrsh7th/nvim-cmp", 179 | config = function() 180 | require("plugins.nvim-cmp") 181 | end, 182 | requires = { 183 | "hrsh7th/cmp-buffer", 184 | "hrsh7th/cmp-nvim-lsp", 185 | "hrsh7th/cmp-path", 186 | "saadparwaiz1/cmp_luasnip", 187 | "hrsh7th/cmp-nvim-lsp-signature-help", 188 | --"tzachar/cmp-tabnine", 189 | }, 190 | }) 191 | use({ -- Typescript LSP enhancements (configured in LSP) 192 | "jose-elias-alvarez/typescript.nvim", 193 | branch = "main", 194 | }) 195 | use({ -- Support for non-LSP stuff via LSP (configured in LSP) 196 | "jose-elias-alvarez/null-ls.nvim", 197 | branch = "main", 198 | }) 199 | use({ -- Show signature help when typing 200 | "ray-x/lsp_signature.nvim", 201 | }) 202 | 203 | -- =======================================-- 204 | -- Workflow plugins -- 205 | -- =======================================-- 206 | use({ 207 | "kyazdani42/nvim-tree.lua", 208 | config = function() 209 | require("plugins.nvim-tree") 210 | end, 211 | }) 212 | 213 | use({ -- Better than fzf, amazing search 214 | "nvim-telescope/telescope.nvim", 215 | requires = { "nvim-lua/popup.nvim", "nvim-lua/plenary.nvim" }, 216 | config = function() 217 | require("plugins.telescope") 218 | end, 219 | }) 220 | use({ -- Dap integration for telescope 221 | "nvim-telescope/telescope-dap.nvim", 222 | }) 223 | use({ -- Better sorting in telescope 224 | "nvim-telescope/telescope-fzf-native.nvim", 225 | run = "make", 226 | }) 227 | use({ -- Telescope fie browser 228 | "nvim-telescope/telescope-file-browser.nvim", 229 | }) 230 | 231 | use({ "moll/vim-bbye", cmd = "Bdelete" }) -- Better buffer management 232 | 233 | -- =======================================-- 234 | -- Experimental (testing plugins) -- 235 | -- =======================================-- 236 | --use({ "folke/lua-dev.nvim" }) 237 | 238 | use({ 239 | "theHamsta/nvim-dap-virtual-text", 240 | config = function() 241 | require("nvim-dap-virtual-text").setup() 242 | end, 243 | }) 244 | 245 | use({ 246 | "beauwilliams/focus.nvim", 247 | config = function() 248 | require("plugins.focus") 249 | end, 250 | event = "VimEnter", 251 | }) 252 | 253 | --use({ 254 | --"neomake/neomake", 255 | --config = function() 256 | --require("plugins.neomake") 257 | --end, 258 | --cmd = "Neomake", 259 | --}) 260 | 261 | use({ 262 | "iamcco/markdown-preview.nvim", 263 | run = "cd app && yarn install", 264 | cmd = "MarkdownPreview", 265 | ft = { "markdown" }, 266 | }) 267 | 268 | use({ 269 | "kndndrj/nvim-dbee", 270 | requires = { 271 | "MunifTanjim/nui.nvim", 272 | }, 273 | run = function() 274 | -- Install tries to automatically detect the install method. 275 | -- if it fails, try calling it with one of these parameters: 276 | -- "curl", "wget", "bitsadmin", "go" 277 | require("dbee").install() 278 | end, 279 | config = function() 280 | require("dbee").setup(--[[optional config]]) 281 | end, 282 | }) 283 | 284 | use({ 285 | "phaazon/hop.nvim", 286 | config = function() 287 | require("plugins.hop") 288 | end, 289 | }) 290 | 291 | use({ 292 | "jcdickinson/codeium.nvim", 293 | requires = { 294 | "nvim-lua/plenary.nvim", 295 | "hrsh7th/nvim-cmp", 296 | }, 297 | config = function() 298 | require("codeium").setup({}) 299 | end, 300 | }) 301 | end) 302 | -------------------------------------------------------------------------------- /nvim/lua/plugins/comment-nvim.lua: -------------------------------------------------------------------------------- 1 | local comment = require("Comment") 2 | 3 | require("Comment").setup({ 4 | toggler = { 5 | ---Line-comment toggle keymap 6 | line = 'cc', 7 | ---Block-comment toggle keymap 8 | block = 'cb', 9 | }, 10 | ---LHS of operator-pending mappings in NORMAL and VISUAL mode 11 | opleader = { 12 | ---Line-comment keymap 13 | line = 'c', 14 | ---Block-comment keymap 15 | block = 'cb', 16 | }, 17 | ---LHS of extra mappings 18 | extra = { 19 | ---Add comment on the line above 20 | above = 'cO', 21 | ---Add comment on the line below 22 | below = 'co', 23 | ---Add comment at the end of line 24 | eol = 'cA', 25 | }, 26 | }) 27 | -------------------------------------------------------------------------------- /nvim/lua/plugins/dressing.lua: -------------------------------------------------------------------------------- 1 | require("dressing").setup({ 2 | select = { 3 | -- Priority list of preferred vim.select implementations 4 | backend = { "builtin" }, 5 | 6 | -- Options for built-in selector 7 | builtin = { 8 | -- These are passed to nvim_open_win 9 | relative = "cursor", 10 | border = "rounded", 11 | 12 | -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) 13 | width = nil, 14 | max_width = 0.8, 15 | min_width = 40, 16 | height = nil, 17 | max_height = 0.9, 18 | min_height = 10, 19 | 20 | win_options = { 21 | -- Window transparency (0-100) 22 | winblend = 10, 23 | -- Change default highlight groups (see :help winhl) 24 | winhighlight = "", 25 | }, 26 | }, 27 | 28 | -- Used to override format_item. See :help dressing-format 29 | format_item_override = {}, 30 | 31 | -- see :help dressing_get_config 32 | get_config = nil, 33 | }, 34 | }) 35 | -------------------------------------------------------------------------------- /nvim/lua/plugins/firenvim.lua: -------------------------------------------------------------------------------- 1 | vim.g.firenvim_config = { 2 | globalSettings = {alt = 'all'}, 3 | localSettings = { 4 | ['https://console.cloud.google.com/'] = { 5 | takeover = 'never', 6 | priority = 20 7 | } 8 | } 9 | } 10 | 11 | vim.cmd([[ 12 | au BufEnter app.zenhub.com_*.txt set filetype=markdown 13 | ]]) 14 | -------------------------------------------------------------------------------- /nvim/lua/plugins/focus.lua: -------------------------------------------------------------------------------- 1 | require'focus'.setup({excluded_filetypes = {"NvimTree", "toggleterm", "term", "fterm"}}) 2 | -------------------------------------------------------------------------------- /nvim/lua/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require('gitsigns').setup { 2 | signs = { 3 | add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, 4 | change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, 5 | delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, 6 | topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, 7 | changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, 8 | }, 9 | numhl = false, 10 | linehl = false, 11 | watch_gitdir = { 12 | interval = 1000 13 | }, 14 | current_line_blame = false, 15 | sign_priority = 6, 16 | update_debounce = 100, 17 | status_formatter = nil, -- Use default 18 | on_attach = function(bufnr) 19 | local function buf_set_keymap(mode, key, func) 20 | vim.keymap.set(mode, key, func, { buffer = bufnr, silent = true }) 21 | end 22 | 23 | buf_set_keymap('n', ']c', require('gitsigns').next_hunk) 24 | buf_set_keymap('n', '[c', require('gitsigns').prev_hunk) 25 | buf_set_keymap('n', 'gs', require"gitsigns".stage_hunk) 26 | buf_set_keymap('n', 'gu', require"gitsigns".undo_stage_hunk) 27 | buf_set_keymap('n', 'gr', require"gitsigns".reset_hunk) 28 | buf_set_keymap('n', 'gR', require"gitsigns".reset_buffer) 29 | buf_set_keymap('n', 'gp', require"gitsigns".preview_hunk) 30 | buf_set_keymap('n', 'gb', require"gitsigns".blame_line) 31 | buf_set_keymap('n', 'gS', require"gitsigns".stage_buffer) 32 | buf_set_keymap('n', 'gU', require"gitsigns".reset_buffer_index) 33 | end 34 | } 35 | -------------------------------------------------------------------------------- /nvim/lua/plugins/hop.lua: -------------------------------------------------------------------------------- 1 | local hop = require("hop") 2 | 3 | hop.setup({}) 4 | 5 | vim.api.nvim_set_keymap("n", "H", "[hop]", {}) 6 | vim.keymap.set("n", "[hop]h", function() 7 | hop.char2() 8 | end, {}) 9 | vim.keymap.set("n", "[hop]s", function() 10 | hop.pattern() 11 | end, {}) 12 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp-inlayhints.lua: -------------------------------------------------------------------------------- 1 | require("lsp-inlayhints").setup() 2 | 3 | vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) 4 | vim.api.nvim_create_autocmd("LspAttach", { 5 | group = "LspAttach_inlayhints", 6 | callback = function(args) 7 | if not (args.data and args.data.client_id) then 8 | return 9 | end 10 | 11 | local bufnr = args.buf 12 | local client = vim.lsp.get_client_by_id(args.data.client_id) 13 | require("lsp-inlayhints").on_attach(client, bufnr) 14 | end, 15 | }) 16 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp_extensions.lua: -------------------------------------------------------------------------------- 1 | vim.lsp.handlers["textDocument/publishDiagnostics"] = 2 | vim.lsp.with(require('lsp_extensions.workspace.diagnostic').handler, 3 | {signs = {severity_limit = "Error"}}) 4 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lspkind-nvim.lua: -------------------------------------------------------------------------------- 1 | -- Setup completion labels 2 | local lspkind = require 'lspkind' 3 | 4 | local source_mapping = { 5 | buffer = '[Buffer]', 6 | nvim_lsp = '[LSP]', 7 | nvim_lua = '[Lua]', 8 | cmp_tabnine = '[TN]', 9 | path = '[Path]', 10 | codeium = '[Code]', 11 | } 12 | 13 | local format = function(entry, vim_item) 14 | vim_item.kind = lspkind.presets.default[vim_item.kind] 15 | local menu = source_mapping[entry.source.name] 16 | if entry.source.name == 'codeium' then 17 | vim_item.kind = '' 18 | end 19 | if entry.source.name == 'cmp_tabnine' then 20 | if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then 21 | menu = entry.completion_item.data.detail .. ' ' .. menu 22 | end 23 | vim_item.kind = '' 24 | end 25 | vim_item.menu = menu 26 | return vim_item 27 | end 28 | 29 | return format 30 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neogit.lua: -------------------------------------------------------------------------------- 1 | local neogit = require('neogit') 2 | 3 | neogit.setup{ 4 | integrations = { 5 | disable_signs = false, 6 | diffview = false 7 | } 8 | } 9 | 10 | vim.api.nvim_set_keymap('n', 'G', '[neogit]', {}) 11 | vim.api.nvim_set_keymap('n', '[neogit]s', 'Neogit', { silent = true }) 12 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neomake.lua: -------------------------------------------------------------------------------- 1 | vim.g.neomake_lerna_maker = { 2 | exe = 'lerna', 3 | args = {'run', 'build', '--parallel', '--no-bail'}, 4 | process_output = function(context) 5 | local packages = vim.json.decode( 6 | vim.fn['system']( 7 | 'lerna list --json -a --loglevel error 2>/dev/null')) 8 | 9 | local packageMap = {} 10 | 11 | for i = 1, #packages do 12 | package = packages[i] 13 | packageMap[package.name] = package.location 14 | end 15 | 16 | local processed_errors = {} 17 | 18 | if context.source == 'stdout' then 19 | for _, value in ipairs(context.output) do 20 | local package, file, line, col, message = 21 | string.match(value, 22 | "^([^ :]+): ([^(:]+)%((%d+),(%d+)%): (.+)") 23 | if package and #package > 0 then 24 | local path = packageMap[package] .. '/' .. file 25 | 26 | table.insert(processed_errors, { 27 | text = message, 28 | lnum = tonumber(line), 29 | col = tonumber(col), 30 | filename = path, 31 | type = 'E' 32 | }) 33 | end 34 | end 35 | end 36 | 37 | return processed_errors 38 | end 39 | } 40 | 41 | vim.g.neomake_enabled_makers = {'lerna'} 42 | vim.g.neomake_open_list = 2 43 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neorg.lua: -------------------------------------------------------------------------------- 1 | require('neorg').setup { 2 | -- Tell Neorg what modules to load 3 | load = { 4 | ["core.defaults"] = {}, -- Load all the default modules 5 | ["core.norg.concealer"] = {}, -- Allows for use of icons 6 | ["core.norg.dirman"] = { -- Manage your directories with Neorg 7 | config = {workspaces = {default = "~/neorg"}} 8 | }, 9 | ["core.neorgcmd"]= {}, -- Load the :Neorg command 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-cmp-tabnine.lua: -------------------------------------------------------------------------------- 1 | local tabnine = require('cmp_tabnine.config') 2 | tabnine:setup({ 3 | max_lines = 1000, 4 | max_num_results = 20, 5 | sort = true, 6 | run_on_every_keystroke = true, 7 | snippet_placeholder = '..', 8 | ignored_file_types = { -- default is not to ignore 9 | -- uncomment to ignore in lua: 10 | -- lua = true 11 | }, 12 | show_prediction_strength = false 13 | }) 14 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp = require("cmp") 2 | local luasnip = require("luasnip") 3 | 4 | local formatting = {} 5 | 6 | if packer_plugins["lspkind-nvim"] then 7 | formatting["format"] = require("plugins.lspkind-nvim") 8 | end 9 | 10 | cmp.setup({ 11 | snippet = { 12 | expand = function(args) 13 | require("luasnip").lsp_expand(args.body) 14 | end, 15 | }, 16 | mapping = cmp.mapping.preset.insert({ 17 | [""] = cmp.mapping.scroll_docs(-4), 18 | [""] = cmp.mapping.scroll_docs(4), 19 | [""] = cmp.mapping.confirm({ 20 | select = true, 21 | behavior = cmp.ConfirmBehavior.Replace, 22 | }), 23 | [""] = cmp.mapping.complete(), 24 | [""] = function(fallback) 25 | if cmp.visible() then 26 | cmp.select_next_item() 27 | elseif luasnip.expand_or_jumpable() then 28 | luasnip.expand_or_jump() 29 | else 30 | fallback() 31 | end 32 | end, 33 | [""] = function(fallback) 34 | if cmp.visible() then 35 | cmp.select_prev_item() 36 | elseif luasnip.jumpable(-1) then 37 | luasnip.jump(-1) 38 | else 39 | fallback() 40 | end 41 | end, 42 | }), 43 | sources = { 44 | { name = "nvim_lsp" }, 45 | { name = "luasnip" }, 46 | { 47 | name = "buffer", 48 | option = { 49 | get_bufnrs = function() 50 | local bufs = {} 51 | for _, win in ipairs(vim.api.nvim_list_wins()) do 52 | bufs[vim.api.nvim_win_get_buf(win)] = true 53 | end 54 | return vim.tbl_keys(bufs) 55 | end, 56 | }, 57 | }, 58 | { name = "path" }, 59 | { name = "nvim_lsp_signature_help" }, 60 | --{name = 'cmp_tabnine'} 61 | { name = "codeium" }, 62 | }, 63 | formatting = formatting, 64 | }) 65 | 66 | --require 'plugins.nvim-cmp-tabnine' 67 | 68 | cmp.setup.cmdline("/", { sources = { { name = "buffer" } } }) 69 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-dap.lua: -------------------------------------------------------------------------------- 1 | local dap = require("dap") 2 | local Job = require("plenary.job") 3 | local vscodeJsAdapter = require("dap-vscode-js.adapter") 4 | local vscodeJsConfig = require("dap-vscode-js.config") 5 | 6 | require("dap-vscode-js").setup({ 7 | node_path = "node", 8 | adapters = {}, -- which adapters to register in nvim-dap 9 | }) 10 | 11 | -- Allow running custom command (build) before running adapter 12 | dap.adapters.node2 = function(cb, config) 13 | if config.preLaunchTask then 14 | vim.fn.system(config.preLaunchTask) 15 | end 16 | local adapter = { 17 | type = "executable", 18 | command = "node", 19 | args = { 20 | os.getenv("HOME") .. "/Pkg/vscode-node-debug2/out/src/nodeDebug.js", 21 | }, 22 | env = config.env or {}, 23 | } 24 | cb(adapter) 25 | end 26 | dap.adapters["pwa-node"] = function(cb, config) 27 | local adapter = vscodeJsAdapter.generate_adapter("pwa-node", vscodeJsConfig) 28 | local isDone = false 29 | 30 | if config.preLaunchTask then 31 | local notification = vim.notify("Running preLaunchTask", vim.log.levels.INFO, { keep = function () return not isDone end }) 32 | 33 | local Terminal = require("toggleterm.terminal").Terminal 34 | 35 | local term = Terminal:new({ 36 | dir = config.cwd, 37 | on_exit = function(t, job, exit_code) 38 | print(exit_code) 39 | if exit_code ~= 0 then 40 | vim.notify( 41 | "preLaunchTask failed", 42 | vim.log.levels.ERROR, 43 | { replace = notification, keep = false } 44 | ) 45 | else 46 | vim.notify( 47 | "preLaunchTask successful, starting debugger", 48 | vim.log.levels.INFO, 49 | { replace = notification, keep = false } 50 | ) 51 | t:close() 52 | adapter(cb) 53 | end 54 | isDone = true; 55 | end, 56 | cmd = config.preLaunchTask, 57 | }) 58 | 59 | term:open() 60 | else 61 | adapter(cb) 62 | end 63 | end 64 | 65 | vim.api.nvim_set_keymap("n", "D", "[DAP]", {}) 66 | vim.api.nvim_set_keymap("n", "[DAP]b", "lua require'dap'.toggle_breakpoint()", {}) 67 | vim.api.nvim_set_keymap( 68 | "n", 69 | "[DAP]B", 70 | "lua require'dap'.toggle_breakpoint(vim.fn.input('Breakpoint condition: '))", 71 | {} 72 | ) 73 | vim.api.nvim_set_keymap("n", "[DAP]c", "lua require'dap'.continue()", {}) 74 | vim.api.nvim_set_keymap("n", "[DAP]s", "lua require'dap'.step_over()", {}) 75 | vim.api.nvim_set_keymap("n", "[DAP]S", "lua require'dap'.step_into()", {}) 76 | vim.api.nvim_set_keymap("n", "[DAP]r", "lua require'dap'.repl.toggle()", {}) 77 | vim.api.nvim_set_keymap("n", "[DAP]R", "lua require'dap'.restart()", {}) 78 | vim.api.nvim_set_keymap( 79 | "n", 80 | "[DAP]e", 81 | "lua require'dap'.disconnect({ terminateDebuggee = true })lua require'dap'.close()", 82 | {} 83 | ) 84 | 85 | vim.api.nvim_set_keymap("n", "[DAP]h", "lua require'dap.ui.widgets'.hover()", {}) 86 | 87 | vim.api.nvim_set_keymap("n", "[DAP]U", "lua require'dapui'.toggle()", {}) 88 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-lspconfig.lua: -------------------------------------------------------------------------------- 1 | local lspconfig = require("lspconfig") 2 | local null_ls = require("null-ls") 3 | local typescript = require("typescript") 4 | 5 | local function format_buffer() 6 | vim.lsp.buf.format({ 7 | filter = function(client) 8 | return client.name ~= "tsserver" and client.name ~= "pyright" and client.name ~= "eslint" 9 | end, 10 | }) 11 | end 12 | 13 | -- Setup everything on lsp attach 14 | local on_attach = function(client, bufnr) 15 | local function buf_set_keymap(mode, key, func) 16 | vim.keymap.set(mode, key, func, { buffer = bufnr, silent = true }) 17 | end 18 | 19 | -- require'lsp_signature'.on_attach() 20 | 21 | -- Mappings. 22 | buf_set_keymap("n", "gD", vim.lsp.buf.declaration) 23 | buf_set_keymap("n", "gd", vim.lsp.buf.definition) 24 | buf_set_keymap("n", "gh", vim.lsp.buf.hover) 25 | buf_set_keymap("n", "gi", vim.lsp.buf.implementation) 26 | buf_set_keymap("n", "", vim.lsp.buf.signature_help) 27 | buf_set_keymap("n", "rm", vim.lsp.buf.rename) 28 | buf_set_keymap("n", "rr", vim.lsp.buf.references) 29 | buf_set_keymap("n", "d", vim.diagnostic.open_float) 30 | 31 | buf_set_keymap("n", "i", vim.lsp.buf.code_action) 32 | buf_set_keymap("n", "[d", vim.diagnostic.goto_prev) 33 | buf_set_keymap("n", "]d", vim.diagnostic.goto_next) 34 | 35 | vim.keymap.set("n", "=", format_buffer, { buffer = bufnr }) 36 | if client.server_capabilities.document_range_formatting then 37 | vim.keymap.set("v", "=", format_buffer, { buffer = bufnr }) 38 | end 39 | end 40 | 41 | local handle_lsp = function(opts) 42 | return opts 43 | end 44 | 45 | --local ts_utils_attach = require 'plugins.lsp-ts-utils' 46 | 47 | null_ls.setup({ 48 | on_attach = on_attach, 49 | sources = { 50 | -- JS/TS formatting 51 | null_ls.builtins.formatting.prettierd, 52 | -- Spell check 53 | --null_ls.builtins.diagnostics.cspell, 54 | -- Python formatting 55 | null_ls.builtins.formatting.autopep8.with({ 56 | extra_args = { 57 | "max-line-length", 58 | "79", 59 | "aggressive", 60 | "aggressive", 61 | "aggressive", 62 | }, 63 | }), 64 | -- Lua formatting 65 | null_ls.builtins.formatting.stylua, 66 | }, 67 | root_dir = lspconfig.util.root_pattern("yarn.lock", "lerna.json", ".git"), 68 | --debug = true, 69 | log = { enabled = true, level = "trace" }, 70 | }) 71 | 72 | local capabilities = vim.lsp.protocol.make_client_capabilities() 73 | 74 | local capabilitiesWithoutFomatting = vim.lsp.protocol.make_client_capabilities() 75 | capabilitiesWithoutFomatting.textDocument.formatting = false 76 | capabilitiesWithoutFomatting.textDocument.rangeFormatting = false 77 | capabilitiesWithoutFomatting.textDocument.range_formatting = false 78 | 79 | -- Tsserver setup 80 | require("typescript").setup({ 81 | disable_commands = false, -- prevent the plugin from creating Vim commands 82 | debug = false, -- enable debug logging for commands 83 | go_to_source_definition = { 84 | fallback = true, -- fall back to standard LSP definition on failure 85 | }, 86 | server = handle_lsp({ 87 | root_dir = lspconfig.util.root_pattern("yarn.lock", "lerna.json", ".git"), 88 | on_attach = function(client, bufnr) 89 | client.server_capabilities.document_formatting = false 90 | client.server_capabilities.document_range_formatting = false 91 | 92 | --ts_utils_attach(client) 93 | on_attach(client, bufnr) 94 | end, 95 | settings = { 96 | documentFormatting = false, 97 | typescript = { 98 | inlayHints = { 99 | includeInlayParameterNameHints = "all", 100 | includeInlayParameterNameHintsWhenArgumentMatchesName = false, 101 | includeInlayFunctionParameterTypeHints = true, 102 | includeInlayVariableTypeHints = true, 103 | includeInlayPropertyDeclarationTypeHints = true, 104 | includeInlayFunctionLikeReturnTypeHints = true, 105 | includeInlayEnumMemberValueHints = true, 106 | }, 107 | }, 108 | }, 109 | init_options = { 110 | hostInfo = "neovim", 111 | maxTsServerMemory = "8192", 112 | preferences = { quotePreference = "single", allowIncompleteCompletions = false }, 113 | --tsserver = { 114 | --path = "/home/armeeh/.config/yarn/global/node_modules/typescript/lib/tsserver.js", 115 | --}, 116 | }, 117 | capabilities = capabilitiesWithoutFomatting, 118 | }), 119 | }) 120 | 121 | --local luadev = require("lua-dev").setup({ 122 | --lspconfig = { 123 | --cmd = { 124 | --"/usr/bin/lua-language-server", 125 | --"-E", 126 | --"/usr/share/lua-language-server/main.lua", 127 | --}, 128 | --on_attach = on_attach, 129 | --capabilities = capabilities, 130 | --}, 131 | --}) 132 | --lspconfig.sumneko_lua.setup(handle_lsp(luadev)) 133 | 134 | -- Vim lsp 135 | lspconfig.vimls.setup(handle_lsp({ 136 | on_attach = on_attach, 137 | capabilities = capabilities, 138 | })) 139 | 140 | -- JSON lsp 141 | lspconfig.jsonls.setup(handle_lsp({ 142 | on_attach = on_attach, 143 | settings = { 144 | json = { 145 | -- Schemas https://www.schemastore.org 146 | schemas = { 147 | { 148 | fileMatch = { "package.json" }, 149 | url = "https://json.schemastore.org/package.json", 150 | }, 151 | { 152 | fileMatch = { "tsconfig*.json" }, 153 | url = "https://json.schemastore.org/tsconfig.json", 154 | }, 155 | { 156 | fileMatch = { 157 | ".prettierrc", 158 | ".prettierrc.json", 159 | "prettier.config.json", 160 | }, 161 | url = "https://json.schemastore.org/prettierrc.json", 162 | }, 163 | { 164 | fileMatch = { ".eslintrc", ".eslintrc.json" }, 165 | url = "https://json.schemastore.org/eslintrc.json", 166 | }, 167 | { 168 | fileMatch = { 169 | ".babelrc", 170 | ".babelrc.json", 171 | "babel.config.json", 172 | }, 173 | url = "https://json.schemastore.org/babelrc.json", 174 | }, 175 | { 176 | fileMatch = { "lerna.json" }, 177 | url = "https://json.schemastore.org/lerna.json", 178 | }, 179 | { 180 | fileMatch = { "now.json", "vercel.json" }, 181 | url = "https://json.schemastore.org/now.json", 182 | }, 183 | { 184 | fileMatch = { 185 | ".stylelintrc", 186 | ".stylelintrc.json", 187 | "stylelint.config.json", 188 | }, 189 | url = "http://json.schemastore.org/stylelintrc.json", 190 | }, 191 | }, 192 | }, 193 | }, 194 | capabilities = capabilities, 195 | })) 196 | 197 | lspconfig.eslint.setup(handle_lsp({ 198 | root_dir = lspconfig.util.root_pattern("yarn.lock", "lerna.json", ".git"), 199 | on_attach = on_attach, 200 | })) 201 | 202 | lspconfig.prismals.setup(handle_lsp({ on_attach = on_attach })) 203 | 204 | lspconfig.cssls.setup(handle_lsp({ 205 | capabilities = capabilities, 206 | root_dir = lspconfig.util.root_pattern("yarn.lock", "lerna.json", ".git"), 207 | on_attach = on_attach, 208 | })) 209 | 210 | lspconfig.pylsp.setup(handle_lsp({ 211 | root_dir = lspconfig.util.root_pattern(".venv", ".git"), 212 | on_attach = on_attach, 213 | settings = { python = { venvPath = "/home/armeeh/.virtualenvs" } }, 214 | })) 215 | 216 | lspconfig.ccls.setup(handle_lsp({ 217 | root_dir = lspconfig.util.root_pattern("yarn.lock", "lerna.json", ".git"), 218 | on_attach = on_attach, 219 | })) 220 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-lsputils.lua: -------------------------------------------------------------------------------- 1 | -- Use ehanced LSP stuff 2 | vim.lsp.handlers['textDocument/codeAction'] = 3 | require'lsputil.codeAction'.code_action_handler 4 | vim.lsp.handlers['textDocument/references'] = 5 | require'lsputil.locations'.references_handler 6 | vim.lsp.handlers['textDocument/definition'] = 7 | require'lsputil.locations'.definition_handler 8 | vim.lsp.handlers['textDocument/declaration'] = 9 | require'lsputil.locations'.declaration_handler 10 | vim.lsp.handlers['textDocument/typeDefinition'] = 11 | require'lsputil.locations'.typeDefinition_handler 12 | vim.lsp.handlers['textDocument/implementation'] = 13 | require'lsputil.locations'.implementation_handler 14 | vim.lsp.handlers['textDocument/documentSymbol'] = 15 | require'lsputil.symbols'.document_handler 16 | vim.lsp.handlers['workspace/symbol'] = 17 | require'lsputil.symbols'.workspace_handler 18 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-lualine.lua: -------------------------------------------------------------------------------- 1 | local lualine = require('lualine') 2 | 3 | lualine.setup { 4 | options = { 5 | theme = 'material-nvim', 6 | icons_enabled = true, 7 | component_separators = {'', ''}, 8 | section_separators = {'', ''}, 9 | disabled_filetypes = {}, 10 | globalstatus = true 11 | }, 12 | --extensions = {'nvim-tree'}, 13 | 14 | sections = { 15 | lualine_a = {'mode'}, 16 | --lualine_b = {'branch', 'nvim_diagnostics'}, 17 | lualine_c = {'filename'}, 18 | lualine_x = {'encoding', 'fileformat', 'filetype'}, 19 | lualine_z = {'location'} 20 | }, 21 | 22 | inactive_sections = { 23 | lualine_a = {}, 24 | lualine_b = {}, 25 | lualine_c = {'filename'}, 26 | lualine_x = {'location'}, 27 | lualine_y = {}, 28 | lualine_z = {} 29 | }, 30 | 31 | tabline = {} 32 | } 33 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | require("nvim-tree").setup({ 2 | view = { 3 | adaptive_size = true, 4 | }, 5 | }) 6 | 7 | local api = require("nvim-tree.api") 8 | 9 | vim.api.nvim_set_keymap("n", "m", "[NvimTree]", {}) 10 | vim.keymap.set("n", "[NvimTree]t", function() 11 | api.tree.toggle({ focus = true }) 12 | end) 13 | vim.keymap.set("n", "[NvimTree]f", function() 14 | api.tree.find_file({ focus = true, open = true }) 15 | end) 16 | vim.keymap.set("n", "[NvimTree]F", api.tree.focus) 17 | -------------------------------------------------------------------------------- /nvim/lua/plugins/rest-nvim.lua: -------------------------------------------------------------------------------- 1 | vim.cmd [[ 2 | augroup rest_mapping 3 | autocmd! 4 | autocmd FileType http lua require 'plugins.rest-nvim'.bind() 5 | augroup END 6 | ]] 7 | 8 | local m = {} 9 | 10 | function m.setup() 11 | require("rest-nvim").setup({ 12 | -- Open request results in a horizontal split 13 | result_split_horizontal = false, 14 | -- Skip SSL verification, useful for unknown certificates 15 | skip_ssl_verification = false, 16 | 17 | -- Highlight request on run 18 | highlight = {enabled = true, timeout = 150}, 19 | 20 | -- Jump to request line on run 21 | 22 | jump_to_request = false 23 | }) 24 | end 25 | 26 | function m.bind() 27 | vim.api.nvim_buf_set_keymap(0, 'n', 'r', '[rest]', {}) 28 | vim.api.nvim_buf_set_keymap(0, 'n', '[rest]r', 'RestNvim', {}) 29 | vim.api.nvim_buf_set_keymap(0, 'n', '[rest]p', 'RestNvimPreview', {}) 30 | end 31 | return m 32 | -------------------------------------------------------------------------------- /nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | require('telescope').setup { 2 | defaults = { 3 | vimgrep_arguments = { 4 | 'rg', 5 | '--color=never', 6 | '--no-heading', 7 | '--with-filename', 8 | '--line-number', 9 | '--column', 10 | '--smart-case', 11 | }, 12 | prompt_prefix = '> ', 13 | selection_caret = '> ', 14 | entry_prefix = ' ', 15 | initial_mode = 'insert', 16 | selection_strategy = 'reset', 17 | sorting_strategy = 'descending', 18 | layout_strategy = 'horizontal', 19 | layout_config = { 20 | horizontal = { mirror = false }, 21 | vertical = { mirror = false }, 22 | prompt_position = 'bottom', 23 | }, 24 | file_sorter = require('telescope.sorters').get_fuzzy_file, 25 | file_ignore_patterns = {}, 26 | generic_sorter = require('telescope.sorters').get_generic_fuzzy_sorter, 27 | winblend = 0, 28 | border = {}, 29 | borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, 30 | color_devicons = true, 31 | use_less = true, 32 | set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, 33 | file_previewer = require('telescope.previewers').vim_buffer_cat.new, 34 | grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new, 35 | qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new, 36 | 37 | -- Developer configurations: Not meant for general override 38 | buffer_previewer_maker = require('telescope.previewers').buffer_previewer_maker, 39 | path_display = { 'smart' }, 40 | }, 41 | pickers = { buffers = { mappings = { i = { [''] = 'delete_buffer' } } } }, 42 | extensions = { 43 | fzf = { 44 | fuzzy = true, 45 | override_generic_sorter = true, -- override the generic sorter 46 | override_file_sorter = true, -- override the file sorter 47 | case_mode = 'smart_case', -- or "ignore_case" or "respect_case" 48 | -- the default case_mode is "smart_case" 49 | }, 50 | }, 51 | } 52 | 53 | require('telescope').load_extension 'dap' 54 | require('telescope').load_extension 'fzf' 55 | require('telescope').load_extension 'file_browser' 56 | 57 | vim.api.nvim_set_keymap('n', 'f', '[tele]', {}) 58 | vim.api.nvim_set_keymap('n', '[tele]f', 'Telescope find_files theme=get_dropdown', {}) 59 | vim.api.nvim_set_keymap('n', '[tele]g', 'Telescope live_grep theme=get_dropdown', {}) 60 | vim.api.nvim_set_keymap('n', '[tele]b', 'Telescope buffers theme=get_dropdown', {}) 61 | vim.api.nvim_set_keymap('n', '[tele]r', 'Telescope lsp_references theme=get_dropdown', {}) 62 | vim.api.nvim_set_keymap('n', '[tele]R', 'Telescope resume', {}) 63 | vim.api.nvim_set_keymap('n', '[tele]q', 'Telescope quickfix theme=get_dropdown', {}) 64 | vim.api.nvim_set_keymap('n', '[tele]d', 'Telescope lsp_definitions theme=get_dropdown', {}) 65 | vim.api.nvim_set_keymap( 66 | 'n', 67 | '[tele]n', 68 | 'Telescope find_files theme=get_dropdown cwd=~/Documents/Notes/markdown', 69 | {} 70 | ) 71 | vim.api.nvim_set_keymap('n', '[tele]B', 'Telescope file_browser theme=get_dropdown', {}) 72 | 73 | -- Grep in specific directory (defaults to current buffer dir) 74 | vim.keymap.set('n', '[tele]G', function() 75 | vim.ui.input({ prompt = 'Enter directory: ', completion = 'dir', default = vim.fn.expand '%:h' }, function(input) 76 | if input ~= nil then 77 | require('telescope.builtin').live_grep { search_dirs = { input } } 78 | end 79 | end) 80 | end, {}) 81 | 82 | -- Find files in specific directory (defaults to current buffer dir) 83 | vim.keymap.set('n', '[tele]F', function() 84 | vim.ui.input({ prompt = 'Enter directory: ', completion = 'dir', default = vim.fn.expand '%:h' }, function(input) 85 | if input ~= nil then 86 | require('telescope.builtin').find_files { cwd = input } 87 | end 88 | end) 89 | end, {}) 90 | -------------------------------------------------------------------------------- /nvim/lua/plugins/toggleterm.lua: -------------------------------------------------------------------------------- 1 | require'toggleterm'.setup{} 2 | 3 | 4 | vim.api.nvim_set_keymap("n", "t", "[term]", {}) 5 | vim.api.nvim_set_keymap("n", "[term]t", 6 | 'exe v:count1 . "ToggleTerm"', {}) 7 | vim.api.nvim_set_keymap("n", "[term]f", 8 | 'exe v:count1 . "ToggleTerm direction=float"', {}) 9 | vim.api.nvim_set_keymap("n", "[term]v", 10 | 'exe v:count1 . "ToggleTerm direction=horizontal"', {}) 11 | vim.api.nvim_set_keymap("n", "[term]s", 12 | 'exe v:count1 . "ToggleTerm direction=vertical"', {}) 13 | 14 | -- Terminal mode mapping to close current terminal 15 | vim.api.nvim_set_keymap("t", "c", 16 | "ToggleTerm", {}) 17 | -------------------------------------------------------------------------------- /nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | require'nvim-treesitter.configs'.setup { 2 | ensure_installed = { 3 | "typescript", "tsx", "javascript", "python" 4 | }, 5 | indent = {enable = true, disable = {"python"}}, 6 | highlight = {enable = true} 7 | } 8 | -------------------------------------------------------------------------------- /nvim/plugin/packer_compiled.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskallup/dotfiles/2dfaff08e61380be7ef0055370fbf2ea87b95b51/nvim/plugin/packer_compiled.lua -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 100 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | --------------------------------------------------------------------------------