From c19ed85b3d0e49b32af3b8c46fe24b5eec79ba83 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 12 Sep 2021 10:07:31 -0600 Subject: [PATCH] Update dotfiles --- .bash_aliases | 7 +- .bashrc | 49 +++++++++ .config/nvim/coc-settings.json | 8 +- .config/nvim/init.vim | 196 ++++++++++++++++++++++++++------- .tmux.conf | 7 +- .vimrc | 17 +-- 6 files changed, 227 insertions(+), 57 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 3f0e37a..2126604 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -14,9 +14,7 @@ alias tcat='highlight -O ansi --force' alias dc="docker-compose" -# PS1="\n\[\e[30;01m\](\[\e[31;01m\]\w\[\e[30;01m\])\[\e[30;1m\]\n\[\e[30;1m\](\[\e[34m\]\$(/bin/date +'%a %b %e %-I:%M:%S %Z %Y')\[\e[30;1m\])\n\[\e[30;1m\](\[\e[32;1m\]\u @ \h\[\e[30;1m\])-> \[\e[0m\]" - -PS1="\n\[\e[30;01m\](\[\e[31;01m\]\w\[\e[30;01m\]) \[\033[30;01m\]\$(parse_git_branch)\n\[\e[30;1m\]\[\e[30;1m\](\[\e[34m\]\$(/bin/date +'%a %b %e %-I:%M:%S %Z %Y')\[\e[30;1m\])\n\[\e[30;1m\](\[\e[32;1m\]\u\[\e[30;1m\])-> \[\e[0m\]" +PS1="\n\[\e[30;01m\](\[\e[31;01m\]\w\[\e[30;01m\])\[\e[30;1m\]\n\[\e[30;1m\](\[\e[34m\]\$(/bin/date +'%a %b %e %-I:%M:%S %Z %Y')\[\e[30;1m\])\n\[\e[30;1m\](\[\e[32;1m\]\u\[\e[30;1m\])-> \[\e[0m\]" # Use bash-completion, if available [[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \ @@ -46,10 +44,9 @@ source ~/bashscripts/disable_trackpad.bash HISTSIZE=50000 HISTFILESIZE=500000 -export TERM=screen-256color +export TERM=xterm-256color #source $HOME/.sdkman/bin/sdkman-init.sh export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 . $HOME/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true . /home/joey/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true -eval "$(hub alias -s)" diff --git a/.bashrc b/.bashrc index 6855c8a..188828f 100644 --- a/.bashrc +++ b/.bashrc @@ -127,3 +127,52 @@ if [ -f '/home/joey/cloudsdk/google-cloud-sdk/path.bash.inc' ]; then source '/ho if [ -f '/home/joey/cloudsdk/google-cloud-sdk/completion.bash.inc' ]; then source '/home/joey/cloudsdk/google-cloud-sdk/completion.bash.inc'; fi export GOOGLE_APPLICATION_CREDENTIALS="$HOME/Documents/Keys/Test Cloud TTS-28e661a83ec0.json" + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash +export HISTTIMEFORMAT="%F %T " + +export BASH_SILENCE_DEPRECATION_WARNING=1 +[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" +alias vim="nvim" +export JAVA_HOME=$(/usr/libexec/java_home -v 16.0.1) + +export PATH="/Users/joey/Library/Python/3.9/bin:$PATH" +export PATH="$HOME/.ghcup/bin/:$PATH" +export PATH="/usr/local/opt/gettext/bin:/usr/local/opt/grep/libexec/gnubin:$PATH" +export PATH="/usr/local/sbin:$PATH" +export PATH="/opt/homebrew/bin:/opt/homebrew/lib:/opt/homebrew/include:$PATH" +export PATH="/Users/joey/.local/bin:/usr/local/bin:$PATH" +export PATH="/usr/local/opt/sqlite/bin:$PATH" +export PATH="$HOME/Nim/bin:$HOME/.nimble/bin:$PATH" +#export PATH="$HOME/.nimble/bin:$PATH" +#export LDFLAGS="-L/usr/local/opt/sqlite/lib" +#export CPPFLAGS="-I/usr/local/opt/sqlite/include" + +#export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig" +eval "$(hub alias -s)" +export PATH="/usr/local/opt/python@3.8/bin:$PATH" +#export PATH="/Library/Developer/CommandLineTools/usr/bin:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib:$PATH" +export LANG="en_US.UTF-8" +export LC_CTYPE="en_US.UTF-8" +export PATH="/usr/local/opt/php@7.3/bin:$PATH" +export PATH="/usr/local/opt/php@7.3/sbin:$PATH" +export GODOT_BIN="/Applications/Godot.app/Contents/MacOS/Godot" + +# opam configuration +test -r /Users/joey/.opam/opam-init/init.sh && . /Users/joey/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true +export PATH="/opt/homebrew/opt/sqlite/bin:$PATH" + +export PATH="/opt/homebrew/opt/llvm/bin:$PATH" +export CPLUS_INCLUDE_PATH=$(llvm-config --includedir):/opt/homebrew/include:$CPLUS_INCLUDE_PATH +export LD_LIBRARY_PATH=$(llvm-config --libdir):/opt/homebrew/lib:$LD_LIBRARY_PATH +source $HOME/.ghcup/env +source /usr/local/lib/bazel/bin/bazel-complete.bash +export PATH="/opt/homebrew/opt/qt\@5/bin:$PATH" + +# export LDFLAGS="-L/opt/homebrew/opt/qt\@5/lib" +# export CPPFLAGS="-I/opt/homebrew/opt/qt\@5/include" + +# export PKG_CONFIG_PATH="/opt/homebrew/opt/qt\@5/lib/pkgconfig" +export CMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt\@5/5.15.2 +alias sshkvm4g="ssh root@172.111.1.101" +alias sshkvm2g="ssh root@172.111.1.102" diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index 63343ef..65965fb 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -16,6 +16,12 @@ "command": "opam", "args": ["config", "exec", "--", "ocamllsp"], "filetypes": ["ocaml", "reason"] - } + }, + "haskell": { + "command": "haskell-language-server-wrapper", + "args": ["--lsp"], + "rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"], + "filetypes": ["haskell", "lhaskell"] + } } } diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index b57654c..443aec2 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -210,13 +210,13 @@ let g:ctrlp_prompt_mappings = { \ } -noremap ˚ :tabr -noremap ∆ :tabl +" noremap ˚ :tabr +" noremap ∆ :tabl noremap ˙ gT noremap ¬ gt -inoremap ˚ :tabri -inoremap ∆ :tabli +" inoremap ˚ :tabri +" inoremap ∆ :tabli inoremap ˙ gTi inoremap ¬ gti @@ -289,19 +289,28 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'kassio/neoterm' Plug 'reasonml-editor/vim-reason-plus' Plug 'jyapayne/vim-code-dark' -Plug 'puremourning/vimspector' +" Plug 'jyapayne/vimspector' Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'kyazdani42/nvim-web-devicons' Plug 'ryanoasis/vim-devicons' Plug 'TimUntersberger/neogit' -Plug 'sindrets/diffview.nvim' -Plug 'lewis6991/gitsigns.nvim' +Plug 'sindrets/diffview.nvim', {'branch': 'main'} +Plug 'lewis6991/gitsigns.nvim', {'branch': 'main'} +Plug 'peterhoeg/vim-qml' +Plug 'KabbAmine/vCoolor.vim' +Plug 'mfussenegger/nvim-dap' +" Plug 'rcarriga/nvim-dap-ui' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'nvim-telescope/telescope-dap.nvim' +Plug 'theHamsta/nvim-dap-virtual-text' "Plug 'baabelfish/nvim-nim' call plug#end() +let g:gitsigns_head = "main" + " lewis6991/gitsigns.nvim lua << EOF require('gitsigns').setup({ @@ -309,6 +318,41 @@ lua << EOF \ }) EOF +" let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-cpptools', 'CodeLLDB' ] +" puremourning/vimspector + " fun! GotoWindow(id) + " :call win_gotoid(a:id) + " endfun + " func! AddToWatch() + " let word = expand("") + " call vimspector#AddWatch(word) + " endfunction + " let g:vimspector_base_dir = expand('$HOME/.config/vimspector-config') + " let g:vimspector_sidebar_width = 60 + " nnoremap da :call vimspector#Launch() + " nnoremap dc :call GotoWindow(g:vimspector_session_windows.code) + " nnoremap dv :call GotoWindow(g:vimspector_session_windows.variables) + " nnoremap dw :call GotoWindow(g:vimspector_session_windows.watches) + " nnoremap ds :call GotoWindow(g:vimspector_session_windows.stack_trace) + " nnoremap do :call GotoWindow(g:vimspector_session_windows.output) + " nnoremap di :call AddToWatch() + " nnoremap dx :call vimspector#Reset() + " nnoremap dX :call vimspector#ClearBreakpoints() + " nnoremap :call vimspector#StepOut() + " nnoremap :call vimspector#StepInto() + " nnoremap :call vimspector#StepOver() + " nnoremap d_ :call vimspector#Restart() + " nnoremap dn :call vimspector#Continue() + " nnoremap drc :call vimspector#RunToCursor() + " nnoremap dh :call vimspector#ToggleBreakpoint() + " nnoremap de :call vimspector#ToggleConditionalBreakpoint() + " let g:vimspector_sign_priority = { + " \ 'vimspectorBP': 998, + " \ 'vimspectorBPCond': 997, + " \ 'vimspectorBPDisabled': 996, + " \ 'vimspectorPC': 999, + " \ } + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 set termguicolors @@ -444,29 +488,6 @@ exe 'hi htmlSpecialTagName guifg='s:keyword " Markdown Highlighting exe 'hi mkdCode guifg='s:builtin -set hlsearch -highlight Search ctermbg=blue ctermfg=white guibg=#006891 guifg=white -highlight IncSearch ctermbg=blue ctermfg=white guifg=#7D008D guibg=white - -filetype on -autocmd ColorScheme * highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen - -highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen -highlight OverLength ctermbg=red ctermfg=black guibg=#592929 gui=bold - -highlight ALEError ctermfg=black ctermbg=red guifg=black guibg=red -highlight ALEErrorSign ctermfg=none ctermbg=black guifg=red guibg=#212121 -highlight ALEWarning ctermfg=black ctermbg=yellow guifg=black guibg=#a09500 -highlight ALEWarningSign ctermfg=yellow ctermbg=none guibg=#212121 guifg=#a09500 -highlight SignColumn ctermbg=darkgrey guibg=#212121 -highlight TabLineFill guibg=none guifg=none gui=none -highlight TabLineSel guibg=#353535 guifg=none -highlight TabLine guibg=none guifg=none - -hi Normal ctermbg=none guibg=none -hi NonText ctermbg=none guibg=none -hi CursorLine cterm=NONE ctermbg=black ctermfg=NONE guibg=black gui=NONE guifg=NONE -set noshowmode " au User asyncomplete_setup call asyncomplete#register_source({ " \ 'name': 'nim', @@ -716,6 +737,7 @@ let g:neoterm_term_per_tab = 1 nnoremap :Ttoggle inoremap :Ttoggle tnoremap :Ttoggle +tnoremap " color scheme colorscheme codedark @@ -731,9 +753,9 @@ highlight ALEErrorSign ctermfg=none ctermbg=black guifg=red guibg=#212121 highlight ALEWarning ctermbg=yellow guibg=#504a08 highlight ALEWarningSign ctermfg=yellow ctermbg=none guibg=#212121 guifg=#ecd517 highlight SignColumn ctermbg=darkgrey guibg=#212121 -highlight TabLineFill guibg=none guifg=none gui=none -highlight TabLineSel guibg=#353535 guifg=none -highlight TabLine guibg=none guifg=none +" highlight TabLineFill guibg=none guifg=none gui=none +" highlight TabLineSel guibg=#353535 guifg=none +" highlight TabLine guibg=none guifg=none highlight CocHighlightText ctermbg=lightblue guibg=#002c4b @@ -783,11 +805,11 @@ endfor " ## end of OPAM user-setup addition for vim / base ## keep this line let g:ale_linters = {'java': []} -" for normal mode - the word under the cursor -nmap di VimspectorBalloonEval -" for visual mode, the visually selected text -xmap di VimspectorBalloonEval -let g:vimspector_enable_mappings = 'HUMAN' +" " for normal mode - the word under the cursor +" nmap di VimspectorBalloonEval +" " for visual mode, the visually selected text +" xmap di VimspectorBalloonEval +" let g:vimspector_enable_mappings = 'HUMAN' " nnoremap :GFiles @@ -805,6 +827,8 @@ _G.telescope_live_grep_in_path = function(path) end EOF +let b:current_syntax = 'nim' + nnoremap :Telescope git_files nnoremap fd :lua telescope_find_files_in_path() nnoremap fD :lua telescope_live_grep_in_path() @@ -819,6 +843,102 @@ nnoremap fs :Telescope lsp_document_symbols nnoremap ff :Telescope live_grep nnoremap FF :Telescope grep_string +" mfussenegger/nvim-dap +lua << EOF +local dap = require('dap') + +function os.capture(cmd) + local f = assert(io.popen(cmd .. ' 2>&1', 'r')) + local s = assert(f:read('*a')) + f:close() + return s +end + +dap.adapters.lldb = { + type = 'executable', + command = '/opt/homebrew/opt/llvm/bin/lldb-vscode', -- adjust as needed + name = "lldb" +} +dap.configurations.nim = { + { + name = "Launch", + type = "lldb", + request = "launch", + program = function() + -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + + print("Compiling...") + local filename = vim.api.nvim_buf_get_name(0) + local res = os.capture('nim c --debugger:native ' .. filename) + print("Running...") + return filename:match("(.+)%..+$"); + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = function() + return vim.fn.input('Args: ', '') + end, + -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: + -- + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + -- + -- Otherwise you might get the following error: + -- + -- Error on launch: Failed to attach to the target process + -- + -- But you should be aware of the implications: + -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html + runInTerminal = false + }, +} + +-- If you want to use this for rust and c, add something like this: + +-- dap.configurations.c = dap.configurations.cpp +-- dap.configurations.nim = dap.configurations.cpp + +vim.fn.sign_define('DapBreakpoint', {text='●', texthl='ErrorMsg', linehl='', numhl=''}) +vim.fn.sign_define('DapBreakpointRejected', {text='●', texthl='LineNr', linehl='', numhl=''}) +vim.fn.sign_define('DapLogPoint', {text='L', texthl='', linehl='', numhl=''}) +vim.fn.sign_define('DapStopped', {text='→', texthl='WarningMsg', linehl='debugPC', numhl=''}) +EOF + +au FileType dap-repl lua require('dap.ext.autocompl').attach() + +nnoremap db :lua require'dap'.toggle_breakpoint() +nnoremap ø :lua require'dap'.step_out() +nnoremap ˚ :lua require'dap'.step_into() +nnoremap ∆ :lua require'dap'.step_over() +nnoremap ds :lua require'dap'.close() +nnoremap dn :lua require'dap'.continue() +nnoremap dk :lua require'dap'.up() +nnoremap dj :lua require'dap'.down() +nnoremap d_ :lua require'dap'.disconnect();require'dap'.stop();require'dap'.run_last() +nnoremap dr :lua require'dap'.repl.toggle()l +nnoremap rc :lua require'dap'.run_to_cursor()l +nnoremap rb :lua require'dap'.reverse_continue()l +"nnoremap di :lua require'dap.ui.variables'.hover() +vnoremap di :lua require'dap.ui.variables'.visual_hover() +nnoremap d? :lua require'dap.ui.variables'.scopes() +nnoremap de :lua require'dap'.set_exception_breakpoints({"all"}) +nnoremap da :lua require'debugHelper'.attach() +nnoremap dA :lua require'debugHelper'.attachToRemote() +nnoremap di :lua require'dap.ui.widgets'.hover() +nnoremap q :q +nnoremap d? :lua local widgets=require'dap.ui.widgets';widgets.centered_float(widgets.scopes) + +" Plug 'nvim-telescope/telescope-dap.nvim' +lua << EOF +require('telescope').setup() +require('telescope').load_extension('dap') +EOF +nnoremap df :Telescope dap frames +nnoremap dc :Telescope dap commands +nnoremap dh :Telescope dap list_breakpoints + +" theHamsta/nvim-dap-virtual-text and mfussenegger/nvim-dap +let g:dap_virtual_text = v:true + " TimUntersberger/neogit and sindrets/diffview.nvim lua << EOF require("neogit").setup { diff --git a/.tmux.conf b/.tmux.conf index 74287fe..7978014 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -9,15 +9,12 @@ # -- general ------------------------------------------------------------------- # Add truecolor support -set-option -ga terminal-overrides ",xterm-256color:Tc" -# Default terminal is 256 colors -# set t_ZH=^[[3m -# set t_ZR=^[[23m set-option -s default-terminal "tmux-256color" set-option -sa terminal-overrides ",xterm-256color:RGB" set-option -sa terminal-overrides ",xterm-255color*:Tc" +# Default terminal is 256 colors -# set -g default-terminal "screen-256color" # colors! +#set -g default-terminal "screen-256color" # colors! setw -g xterm-keys on set -s escape-time 10 # faster command sequences set -sg repeat-time 600 # increase repeat timeout diff --git a/.vimrc b/.vimrc index 6bc2eee..b14c8a8 100644 --- a/.vimrc +++ b/.vimrc @@ -285,6 +285,15 @@ nnoremap :MundoToggle "let base16colorspace=256 " set background=dark "colorscheme base16-default-dark + +autocmd Filetype ocaml setlocal ts=2 sts=2 sw=2 expandtab + +"colorscheme tender + +hi Normal ctermbg=none +hi NonText ctermbg=none +hi CursorLine cterm=NONE ctermbg=black ctermfg=NONE +set noshowmode " ## added by OPAM user-setup for vim / base ## 93ee63e278bdfc07d1139a748ed3fff2 ## you can edit, but keep this line let s:opam_share_dir = system("opam config var share") let s:opam_share_dir = substitute(s:opam_share_dir, '[\r\n]*$', '', '') @@ -317,11 +326,3 @@ for tool in s:opam_packages endif endfor " ## end of OPAM user-setup addition for vim / base ## keep this line -autocmd Filetype ocaml setlocal ts=2 sts=2 sw=2 expandtab - -"colorscheme tender - -hi Normal ctermbg=none -hi NonText ctermbg=none -hi CursorLine cterm=NONE ctermbg=black ctermfg=NONE -set noshowmode