diff --git a/.bash_aliases b/.bash_aliases index 71a349e..e46d371 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -11,13 +11,15 @@ export CXX=g++ alias nv="nvim" alias vim="nvim" alias did="nvim +'normal Go' +'r!date' ~/Documents/did.txt" -alias sshvalheim="ssh 10.0.0.241" -alias sshminecraft="ssh 10.0.0.76" +alias sshvalheim="ssh 192.168.1.173" +alias sshminecraft="ssh 192.168.1.232" +alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew' alias lcat='pygmentize -g -O style=colorful,linenos=1 | grep -P "^\d\d\d\d:"' alias ccat='pygmentize -g' alias hcat='highlight -n -O ansi --force' alias tcat='highlight -O ansi --force' +alias grep='grep --color' alias dc="docker-compose" diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index 1d97f5a..749a76c 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -1,5 +1,7 @@ { "suggest.noselect": true, + "semanticTokens.enable": true, + "semanticTokens.filetypes": ["c", "cpp"], "languageserver": { "rescript": { "enable": true, @@ -9,9 +11,14 @@ "rootPatterns": ["bsconfig.json"] }, "nim": { - "enable": true, - "command": "nimlsp", - "filetypes": [ "nim" ] + "command": "nimlangserver", + "filetypes": ["nim"], + "trace.server": "verbose", + "settings": { + "nim": { + "nimsuggestPath": "~/.nimble/bin/nimsuggest" + } + } }, "ocaml-lsp": { "command": "opam", @@ -25,5 +32,6 @@ "filetypes": ["haskell", "lhaskell"] } }, - "clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/12.0.1/clangd_12.0.1/bin/clangd" + "clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/12.0.1/clangd_12.0.1/bin/clangd", + "python.venvPath": ".venv" } diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 37a8a9e..a98a57f 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,4 +1,6 @@ - +lua << EOF + vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" +EOF call plug#begin('~/.local/share/nvim/plugged') Plug 'rust-lang/rust.vim' @@ -22,9 +24,12 @@ Plug 'vim-scripts/errormarker.vim' Plug 'elixir-lang/vim-elixir' Plug 'jreybert/vim-largefile' Plug 'sbdchd/neoformat' -Plug 'tpope/vim-obsession' -Plug 'dhruvasagar/vim-prosession' +Plug 'tikhomirov/vim-glsl' +Plug 'svermeulen/vim-easyclip' +" Plug 'tpope/vim-obsession' +" Plug 'dhruvasagar/vim-prosession' Plug 'tmux-plugins/vim-tmux-focus-events' +Plug 'rmagatti/auto-session' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Plug 'vim-syntastic/syntastic' @@ -48,7 +53,6 @@ Plug 'kana/vim-textobj-line' Plug 'Julian/vim-textobj-brace' Plug 'bps/vim-textobj-python' Plug 'wellle/targets.vim' -Plug 'svermeulen/vim-easyclip' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'jremmen/vim-ripgrep' @@ -68,8 +72,10 @@ Plug 'sindrets/diffview.nvim', {'branch': 'main'} Plug 'lewis6991/gitsigns.nvim', {'branch': 'main'} Plug 'peterhoeg/vim-qml' Plug 'mfussenegger/nvim-dap' +Plug 'posva/vim-vue' " Plug 'rcarriga/nvim-dap-ui' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +" Plug 'nvim-treesitter/playground' Plug 'nvim-telescope/telescope-dap.nvim' Plug 'theHamsta/nvim-dap-virtual-text' Plug 'mfussenegger/nvim-dap-python' @@ -77,11 +83,13 @@ Plug 'KabbAmine/vCoolor.vim' " Plug 'chrisbra/Colorizer' Plug 'norcalli/nvim-colorizer.lua' Plug 'edluffy/hologram.nvim' -Plug 'hashivim/vim-terraform' Plug 'fatih/vim-go' +Plug 'folke/trouble.nvim' + "Plug 'baabelfish/nvim-nim' call plug#end() +let g:EasyClipUseGlobalPasteToggle = 0 " map [1;5A " map [1;5B @@ -177,6 +185,8 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT let g:NERDTreeDirArrowExpandable = 'â–¸' let g:NERDTreeDirArrowCollapsible = 'â–¾' autocmd Filetype nim setlocal ts=2 sts=2 sw=2 expandtab +autocmd Filetype ts setlocal ts=2 sts=2 sw=2 expandtab +autocmd Filetype vue setlocal ts=2 sts=2 sw=2 expandtab autocmd Filetype less setlocal ts=2 sts=2 sw=2 expandtab autocmd Filetype css setlocal ts=2 sts=2 sw=2 expandtab let g:syntastic_javascript_checkers = ['eslint', 'flow'] @@ -226,7 +236,7 @@ nmap =j :%!python3 -m json.tool if !exists("autocommands_loaded") let autocommands_loaded = 1 - autocmd BufRead,BufNewFile,FileReadPost *.py source ~/.vim/python + " autocmd BufRead,BufNewFile,FileReadPost *.py source ~/.vim/python endif au BufRead,BufNewFile *.shpaml setfiletype shpaml @@ -303,11 +313,19 @@ let g:ctrlp_prompt_mappings = { noremap Ë™ gT noremap ¬ gt +noremap gT +noremap gt + + + " inoremap Ëš :tabri " inoremap ∆ :tabli inoremap Ë™ gTi inoremap ¬ gti +inoremap gTi +inoremap gti + set clipboard= let g:EasyClipShareYanks = 1 @@ -325,9 +343,7 @@ let g:gitsigns_head = "main" " lewis6991/gitsigns.nvim lua << EOF - require('gitsigns').setup({ - \ word_diff = true - \ }) + require('gitsigns').setup({word_diff = true }) EOF " let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-cpptools', 'CodeLLDB' ] @@ -502,29 +518,6 @@ exe 'hi htmlSpecialTagName guifg='s:keyword exe 'hi mkdCode guifg='s:builtin -" au User asyncomplete_setup call asyncomplete#register_source({ -" \ 'name': 'nim', -" \ 'whitelist': ['nim'], -" \ 'triggers': {'nim': ['.'] }, -" \ 'completor': {opt, ctx -> nim#suggest#sug#GetAllCandidates({start, candidates -> asyncomplete#complete(opt['name'], ctx, start, candidates)})} -" \ }) - -" inoremap pumvisible() ? "\" : "\" -" inoremap pumvisible() ? "\" : "\" -" inoremap pumvisible() ? "\" : "\" -" imap . .(asyncomplete_force_refresh) - -" let g:asyncomplete_auto_popup = 0 - -" function! s:check_back_space() abort -" let col = col('.') - 1 -" return !col || getline('.')[col - 1] =~ '\s' -" endfunction - -" inoremap -" \ pumvisible() ? "\" : -" \ check_back_space() ? "\" : -" \ asyncomplete#force_refresh() "inoremap pumvisible() ? "\" : "\" autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif @@ -579,6 +572,8 @@ let g:asyncomplete_auto_completeopt=0 " Set internal encoding of vim, not needed on neovim, since coc.nvim using some " unicode characters in the file autoload/float.vim set encoding=utf-8 +set nobackup +set nowritebackup " TextEdit might fail if hidden is not set. set hidden @@ -825,7 +820,7 @@ set noshowmode " endfor " ## end of OPAM user-setup addition for vim / base ## keep this line -let g:ale_linters = {'java': [], 'python': []} +let g:ale_linters = {'java': [], 'python': [], 'typescript': []} " " for normal mode - the word under the cursor " nmap di VimspectorBalloonEval @@ -857,7 +852,7 @@ EOF lua << EOF require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" (the four listed parsers should always be installed) - ensure_installed = { "c", "lua", "vim", "help", "go", "python" }, + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "go" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, @@ -887,19 +882,41 @@ require'nvim-treesitter.configs'.setup { -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false, -- Whether the query persists across vim sessions + keybindings = { + toggle_query_editor = 'o', + toggle_hl_groups = 'i', + toggle_injected_languages = 't', + toggle_anonymous_nodes = 'a', + toggle_language_display = 'I', + focus_language = 'f', + unfocus_language = 'F', + update = 'R', + goto_node = '', + show_help = '?', + }, + } +} +require('auto-session').setup { + auto_save_enabled = true, + auto_restore_enabled = true } EOF let b:current_syntax = 'nim' -nnoremap :Telescope git_files +nnoremap :Telescope find_files nnoremap fd :lua telescope_find_files_in_path() nnoremap fD :lua telescope_live_grep_in_path() nnoremap ft :lua telescope_find_files_in_path("./tests") nnoremap fT :lua telescope_live_grep_in_path("./tests") " nnoremap ff :Telescope live_grep nnoremap fo :Telescope file_browser -nnoremap fn :Telescope find_files +nnoremap fn :Telescope git_files nnoremap fg :Telescope git_branches nnoremap fb :Telescope buffers nnoremap fs :Telescope lsp_document_symbols @@ -1056,3 +1073,8 @@ nmap :CocCommand java.debug.vimspector.start let @t = '/^proc ?^\_[\n]## V/\_[€kb€kb€kb^\_[\n\€kb]prc€kboc m/\.} pdd' let &t_SI = "\e[5 q" let &t_EI = "\e[2 q" + +au FileType vue let b:coc_root_patterns = ['.git', '.env', 'package.json', 'tsconfig.json', 'jsconfig.json', 'vite.config.ts', 'vite.config.js', 'vue.config.js', 'nuxt.config.ts'] + +autocmd Filetype typescript setlocal ts=2 sts=2 sw=2 expandtab +autocmd Filetype vue setlocal ts=2 sts=2 sw=2 expandtab diff --git a/.gitconfig b/.gitconfig index 05ee453..bf95eb9 100644 --- a/.gitconfig +++ b/.gitconfig @@ -6,11 +6,11 @@ [core] editor = nvim autocrlf = input - pager = diff-so-fancy | less --tabs=4 -RFX + compression = 9 [pull] rebase = false [color] - ui = true + ui = auto [push] default = current [alias] @@ -22,20 +22,7 @@ # (better for interactive use) stat = !bash -c 'source $HOME/.bashrc && git diff --stat $(git merge-base HEAD \"$(git basebranch)\")' review = !nvim -p $(git files) +\"tabdo Gdiff $(git basebranch)\" +\"let g:gitgutter_diff_base = '$(git basebranch)'\" -[interactive] - diffFilter = diff-so-fancy --patch -[color "diff-highlight"] - oldNormal = red bold - oldHighlight = red bold 52 - newNormal = green bold - newHighlight = green bold 22 -[color "diff"] - meta = 11 - frag = magenta bold - func = 146 bold - commit = yellow bold - old = red bold - new = green bold - whitespace = red reverse [commit] gpgsign = true +[init] + defaultBranch = master diff --git a/.tmux.conf b/.tmux.conf index 242dde6..a0d5d31 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -178,6 +178,11 @@ set -g @plugin 'nhdaly/tmux-better-mouse-mode' set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'tmux-plugins/tmux-resurrect' +# for vim +set -g @resurrect-strategy-vim 'session' +# for neovim +set -g @resurrect-strategy-nvim 'session' + # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator is_vim="ps -o state= -o comm= -t '#{pane_tty}' \