From 2aabf6bb5d873d41805cf98c0790d55388453859 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 19 Sep 2021 16:35:29 -0700 Subject: [PATCH 01/24] zsh: added more usage info to todo() --- .zshrc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index ce247c4..7053fc6 100644 --- a/.zshrc +++ b/.zshrc @@ -154,12 +154,16 @@ done } - # an improved way to manage the todo list + # a simple way to manage your todo list # Usage: - # todo -- edit ~/todo - # todo auto -- commit ~/todo and push with message 'todo' - # todo [git command string] -- manage todo for easy syncing, assuming ~/todo is + # todo -- edit ~/todo + # todo auto -- commit and push ~/todo with message 'todo' + # todo [any git command] -- manage todo for easy syncing, assuming ~/todo is # a symlink that points to a file in a git repo + # + # Suggested use: make a git repo for holding your todo list, then make + # a symlink called 'todo' that points to your todo list in your home directory + # todo() { ( # subshell to protect against directory changes todo_dir="$(dirname "$(realpath ~/todo)")" @@ -168,7 +172,8 @@ $EDITOR ~/todo elif [ "$@" = 'auto' ];then cd "$todo_dir" - git commit "$(realpath ~/todo)" -m 'todo' && todo push + git commit "$(realpath ~/todo)" -m 'todo' + git push else cd "$todo_dir" git $@ @@ -626,5 +631,6 @@ add-zsh-hook preexec mzc_termsupport_preexec # Optionally source the user's customized .zshrc [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0 -# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 +# filetype is sh for language server +# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3 From ec7b60a377436a1f9db9f76e1dd82c0867975db8 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 19 Sep 2021 16:45:25 -0700 Subject: [PATCH 02/24] added dotfiles init script (so you can make your own repo!) --- .local/bin/dotfiles-init.sh | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 .local/bin/dotfiles-init.sh diff --git a/.local/bin/dotfiles-init.sh b/.local/bin/dotfiles-init.sh new file mode 100755 index 0000000..a9dddcd --- /dev/null +++ b/.local/bin/dotfiles-init.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# this will setup a bare git repo for managing dotfiles. You should only run this script once per set of dotfiles. +# credit for this idea and basic script outline goes to: https://www.atlassian.com/git/tutorials/dotfiles + +set -e + +# name the path to the dotfiles repo +DOTFILES_REPO_DIR="$HOME/git/dotfiles" + +# Some colors to spice things up + Cyan="$( tput setaf 6 )" +Green="$( tput setaf 2 )" + NC="$( tput sgr0 )" # No Color + +# check for the git command and exit if it doesn't exist +if ! command -v git > /dev/null;then + echo 'git is not installed or could not be found in $PATH, please install git to proceed' + exit 1 +fi + +# an "alias" for the git command for use by the script +dot() { + git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@" +} + + +mkdir -p "$DOTFILES_REPO_DIR" +if git init --bare "$DOTFILES_REPO_DIR" > /dev/null 2>&1; then + echo "A bare git repository has been initialized at $DOTFILES_REPO_DIR" + echo +else + echo 'git repository initialization failed' + exit +fi +dot config --local status.showUntrackedFiles no +echo "Please add this alias to your shell's init script:" +# looks like this: alias dot="git --git-dir="/path/to/repo" --work-tree=\"$HOME\"" +echo " ${Cyan}alias dot=${Green}\"git --git-dir=\"$DOTFILES_REPO_DIR\" --work-tree=\\\"\$HOME\\\"\"${NC}" +echo "Then, you can use the command '${Cyan}dot ${Green}add ${NC}' to add a given file to the repo" + From a070ef1e6a128e75920c8c0ec1cd201a126768a6 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 00:45:59 -0700 Subject: [PATCH 03/24] Minor changes to a comment --- .zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 1da6590..11278cf 100644 --- a/.zshrc +++ b/.zshrc @@ -467,14 +467,15 @@ bindkey '^[Oc' forward-word # bindkey '^[Od' backward-word # bindkey '^[[1;5D' backward-word # bindkey '^[[1;5C' forward-word # +# Delete words with ctrl+bksp/del bindkey '^H' backward-kill-word # delete previous word with ctrl+backspace bindkey '^[[3;5~' kill-word # delete next word with ctrl+delete bindkey '^[[Z' undo # Shift+tab undo last action # bind UP and DOWN arrow keys to history substring search zmodload zsh/terminfo -bindkey "$terminfo[kcuu1]" history-substring-search-up -bindkey "$terminfo[kcud1]" history-substring-search-down +# bindkey "$terminfo[kcuu1]" history-substring-search-up +# bindkey "$terminfo[kcud1]" history-substring-search-down bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down bindkey -M vicmd 'k' history-substring-search-up From aaeaee4ec6260a45339f22ef1d913822be9381e7 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 00:52:52 -0700 Subject: [PATCH 04/24] fix for termux on android --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 11278cf..c3e7fb2 100644 --- a/.zshrc +++ b/.zshrc @@ -493,7 +493,7 @@ export LESS_TERMCAP_us=$'\E[01;36m' export LESS=-R autoload -U compinit colors zcalc -compinit -d +compinit -d 2>&1 > /dev/null colors # <<< ### Various manjaro ZSH functions >>> From bd43ab1c1da2c9430b898a5c364d8f092351c093 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 00:54:03 -0700 Subject: [PATCH 05/24] uncommented some important lines --- .zshrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index c3e7fb2..cfdbbe4 100644 --- a/.zshrc +++ b/.zshrc @@ -376,12 +376,12 @@ zinit load "zsh-users/zsh-completions" # Themes - # terminal colors - # if [[ -f ~/.config/shell/colors.sh ]];then - # source ~/.config/shell/colors.sh - # else - # zinit snippet 'https://github.com/chriskempson/base16-shell/blob/master/scripts/base16-onedark.sh' # onedark shell colors - # fi + terminal colors + if [[ -f ~/.config/shell/colors.sh ]];then + source ~/.config/shell/colors.sh + else + zinit snippet 'https://github.com/chriskempson/base16-shell/blob/master/scripts/base16-onedark.sh' # onedark shell colors + fi zinit load "romkatv/powerlevel10k" zinit ice atclone"dircolors -b ./src/dir_colors > colors.zsh" \ atpull'%atclone' pick"colors.zsh" nocompile'!' \ From c04891dd675a676839d3c58542bf37afe16aeb54 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 00:55:59 -0700 Subject: [PATCH 06/24] Fixed comment --- .zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index cfdbbe4..ac37624 100644 --- a/.zshrc +++ b/.zshrc @@ -375,8 +375,8 @@ zinit load "zsh-users/zsh-history-substring-search" zinit load "zsh-users/zsh-completions" - # Themes - terminal colors + ## Themes + # terminal colors if [[ -f ~/.config/shell/colors.sh ]];then source ~/.config/shell/colors.sh else From a4d31650c53c2d355021cf555935dcce9bb9ab70 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 02:07:28 -0700 Subject: [PATCH 07/24] Modified todo alias. Make the todo file into a symlink file that points to the actual todo file, in whatever format you want it to be now. --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index ac37624..f8ea0c1 100644 --- a/.zshrc +++ b/.zshrc @@ -87,7 +87,7 @@ alias \ nvc="(cd ~/.config/nvim && nvim)" \ zshrc="$EDITOR ~/.zshrc" \ - todo="$EDITOR ~/todo.md" \ + todo="$EDITOR ~/todo" \ fstab="sudo $EDITOR /etc/fstab" \ # Git cLONE From f0af0f67b8f24a70be62215c3bbeba32d94295c4 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 02:58:25 -0700 Subject: [PATCH 08/24] improved `todo` alias by changing it into a function --- .zshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index f8ea0c1..91c1c14 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,7 @@ #!/bin/zsh # Blake's ZSH config file -# vim:fdm=marker:fmr=>>>,<<<:expandtab:sw=3 +# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 ### Basic shell configuration >>> ### Environment variables >>> @@ -87,7 +87,6 @@ alias \ nvc="(cd ~/.config/nvim && nvim)" \ zshrc="$EDITOR ~/.zshrc" \ - todo="$EDITOR ~/todo" \ fstab="sudo $EDITOR /etc/fstab" \ # Git cLONE @@ -157,6 +156,13 @@ done } + # an improved way to manage the todo list + todo() { + cd "$(dirname "$(realpath ~/todo)")" + test -d .git || git rev-parse --git-dir > /dev/null 2>&1 && echo 'pulling repository' && git pull + "$EDITOR" ~/todo + } + # Simple extraction script. Taken from manjaro's .bashrc ex() { if [ -f $1 ] ; then From a8165e94c2c0c59deaf315817fe9fa8ec529cf50 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 21:42:31 -0700 Subject: [PATCH 09/24] Initial DAP support --- .config/nvim/lua/lsp.lua | 68 ++++++++++++++++++++++++++++-------- .config/nvim/lua/plugins.lua | 21 ++++++++--- 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index ec8d378..a3322cf 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -1,14 +1,15 @@ local M = {} -M.signature = function() ---- lsp_signature >>> +-- lsp_signature >>> +M.signature = function() require "lsp_signature".setup() cfg = { Gse_lspsaga = true } -end --- <<< +end -- <<< -M.lspinstall = function() ---- lspinstall >>> +-- lspinstall >>> +M.lspinstall = function() -- local function setup_servers() require'lspinstall'.setup() local servers = require'lspinstall'.installed_servers() @@ -24,10 +25,10 @@ M.lspinstall = function() ---- lspinstall >>> setup_servers() -- reload installed servers vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server end -end --- <<< +end -- <<< -M.treesitter = function() ---- treesitter >>> +-- treesitter >>> +M.treesitter = function() require('nvim-treesitter.configs').setup { highlight = { enable = true, -- false will disable the whole extension @@ -95,10 +96,10 @@ M.treesitter = function() ---- treesitter >>> -- enable = true -- } -- } -end --- <<< +end -- <<< -M.cmp = function() ---- cmp >>> +-- cmp >>> +M.cmp = function() -- nvim-cmp supports additional completion capabilities local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) @@ -175,10 +176,10 @@ M.cmp = function() ---- cmp >>> end, }, } -end --- <<< +end -- <<< -M.lspconfig = function() ---- lspconfig >>> +-- lspconfig >>> +M.lspconfig = function() local nvim_lsp = require('lspconfig') -- Use an on_attach function to only map the following keys @@ -225,8 +226,45 @@ M.lspconfig = function() ---- lspconfig >>> } } end -end --- <<< +end -- <<< + +-- DAP: Debug Adapter Protocol >>> +M.dap = function() + -- default keybinds + vim.cmd [[ + nnoremap lua require'dap'.continue() + nnoremap lua require'dap'.step_over() + nnoremap lua require'dap'.step_into() + nnoremap lua require'dap'.step_out() + nnoremap b lua require'dap'.toggle_breakpoint() + nnoremap B lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition ')) + nnoremap lp lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message ')) + nnoremap dl lua require'dap'.run_last() + nnoremap dr lua require'dap'.repl.open() + ]] + local dap = require('dap') + dap.configurations.cpp = { + { + name = "Launch file", + type = "cppdbg", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = true, + }, + } +end -- <<< + +-- DAP installer >>> +M.dapinstall = function() + local dap_install = require("dap-install") + + dap_install.setup({ + installation_path = vim.fn.stdpath("data") .. "/dapinstall/", + }) +end -- <<< return M diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 0f80237..3b4da53 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -10,7 +10,7 @@ end return require('packer').startup(function() -- Packer - use { -- plugins + use { -- packer 'wbthomason/packer.nvim' } @@ -45,6 +45,18 @@ return require('packer').startup(function() -- end, 0) -- end, } + use { -- DAP: Debug Adapter Protocol >>> + "mfussenegger/nvim-dap", + config = function() + require("lsp").dap() + end + } + use { + "Pocco81/DAPInstall.nvim", + config = function() + require("lsp").dapinstall() + end + } use { -- Default LSP configs "neovim/nvim-lspconfig", after = "nvim-lspinstall", @@ -107,9 +119,9 @@ return require('packer').startup(function() requires = { 'nvim-lua/plenary.nvim' }, - -- config = function() - -- require('other').gitsigns() - -- end + config = function() + require('other').gitsigns() + end, } use { -- file manager 'kyazdani42/nvim-tree.lua', @@ -168,7 +180,6 @@ return require('packer').startup(function() use { -- tpope: Repeatability for various tpope plugins 'tpope/vim-repeat', } - end) -- vim:fdm=marker:fmr={,}:expandtab:tabstop=3:sw=3 From 66e6398d43e9322d167a0fc6a6e0a649df5ec119 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 21:42:49 -0700 Subject: [PATCH 10/24] Gitsigns config --- .config/nvim/lua/other.lua | 81 ++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 7 deletions(-) diff --git a/.config/nvim/lua/other.lua b/.config/nvim/lua/other.lua index 25013bb..142f6c3 100644 --- a/.config/nvim/lua/other.lua +++ b/.config/nvim/lua/other.lua @@ -38,8 +38,7 @@ M.nvimtree = function () { key = "q", cb = tree_cb("close") }, { key = "g?", cb = tree_cb("toggle_help") }, } -end --- <<< +end -- <<< -- toggleterm >>> M.toggleterm = function() @@ -80,10 +79,78 @@ M.toggleterm = function() } } } -end --- <<< +end -- <<< -M.autosession = function() -- Automatic session loading and saving >>> +-- gitsigns >>> +M.gitsigns = function() + require('gitsigns').setup { + signs = { + add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + keymaps = { + -- Default keymap options + noremap = true, + + ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, + + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hr'] = 'lua require"gitsigns".reset_hunk()', + ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', + ['n hR'] = 'lua require"gitsigns".reset_buffer()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hb'] = 'lua require"gitsigns".blame_line(true)', + ['n hS'] = 'lua require"gitsigns".stage_buffer()', + ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', + + -- Text objects + ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', + ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' + }, + watch_index = { + interval = 1000, + follow_files = true + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + }, + current_line_blame_formatter_opts = { + relative_time = false + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = false + }, + } +end -- <<< + +-- Autosession >>> +M.autosession = function() local opts = { log_level = 'info', auto_session_enable_last_session = true, @@ -94,8 +161,8 @@ M.autosession = function() -- Automatic session loading and saving >>> auto_session_suppress_dirs = nil } require('auto-session').setup(opts) -end --- <<< + vim.cmd 'command! SessionSave SaveSession' +end -- <<< return M From 77fc72409839dd41578ff182feddca31c5f339b1 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 10:06:18 -0700 Subject: [PATCH 11/24] QOL improvements --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 91c1c14..20bbaa6 100644 --- a/.zshrc +++ b/.zshrc @@ -85,7 +85,7 @@ # Edit config files alias \ - nvc="(cd ~/.config/nvim && nvim)" \ + nvc="(cd ~/.config/nvim/lua && nvim)" \ zshrc="$EDITOR ~/.zshrc" \ fstab="sudo $EDITOR /etc/fstab" \ @@ -317,6 +317,7 @@ echo 'Error: Could not `cd` into the repo' return 1 fi + ls } calc() { From 297f068dc3fbc6f40e314cf9010ab862c3ce17e2 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 21:38:22 -0700 Subject: [PATCH 12/24] improvements to todo() --- .zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 20bbaa6..502b299 100644 --- a/.zshrc +++ b/.zshrc @@ -158,9 +158,12 @@ # an improved way to manage the todo list todo() { + ( cd "$(dirname "$(realpath ~/todo)")" - test -d .git || git rev-parse --git-dir > /dev/null 2>&1 && echo 'pulling repository' && git pull + # only pull the repo if there is some argument + [ -z "$1" ] || test -d .git || git rev-parse --git-dir > /dev/null 2>&1 && echo 'pulling repository' && git pull "$EDITOR" ~/todo + ) } # Simple extraction script. Taken from manjaro's .bashrc From a8b6b58964d80d8f4833efe79815a5701bad5a1b Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 21:39:21 -0700 Subject: [PATCH 13/24] added markdown preview plugin --- .config/nvim/lua/plugins.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 3b4da53..8e65a67 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -153,6 +153,10 @@ return require('packer').startup(function() require('other').autosession() end } + use { + 'ellisonleao/glow.nvim', + ft = { 'md', 'markdown', } + } -- Conveniences use { -- Undo tree From c2e6e88e272f3710d58a1de5776edcd72db0405a Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 22:02:47 -0700 Subject: [PATCH 14/24] improved todo() --- .zshrc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.zshrc b/.zshrc index 502b299..a4f1173 100644 --- a/.zshrc +++ b/.zshrc @@ -158,11 +158,13 @@ # an improved way to manage the todo list todo() { - ( - cd "$(dirname "$(realpath ~/todo)")" - # only pull the repo if there is some argument - [ -z "$1" ] || test -d .git || git rev-parse --git-dir > /dev/null 2>&1 && echo 'pulling repository' && git pull - "$EDITOR" ~/todo + ( # subshell to protect against directory changes + if [ -z "$@" ];then + $EDITOR ~/todo + else + cd "$(dirname "$(realpath ~/todo)")" + git $@ + fi ) } From 0d08c6b939c9ddd27a6d1bd80fe318a38bf81ccb Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Sep 2021 23:13:22 -0700 Subject: [PATCH 15/24] nvim: added DAP support with nvim-dap, but I just decided I like vimspector more --- .config/nvim/lua/lsp.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index a3322cf..ec223d7 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -232,17 +232,18 @@ end -- <<< M.dap = function() -- default keybinds vim.cmd [[ - nnoremap lua require'dap'.continue() - nnoremap lua require'dap'.step_over() - nnoremap lua require'dap'.step_into() - nnoremap lua require'dap'.step_out() - nnoremap b lua require'dap'.toggle_breakpoint() - nnoremap B lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition ')) - nnoremap lp lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message ')) + nnoremap b lua require'dap'.continue() + nnoremap bo lua require'dap'.step_over() + nnoremap bi lua require'dap'.step_into() + nnoremap bO lua require'dap'.step_out() + nnoremap bb lua require'dap'.toggle_breakpoint() + nnoremap bB lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition ')) + nnoremap blp lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message ')) nnoremap dl lua require'dap'.run_last() nnoremap dr lua require'dap'.repl.open() ]] local dap = require('dap') + -- c++ dap congiguration >>> dap.configurations.cpp = { { name = "Launch file", @@ -255,6 +256,11 @@ M.dap = function() stopOnEntry = true, }, } + dap.adapters.cppdbg = { + type = 'executable', + command = '/home/blake/.local/share/nvim/dapinstall/ccppr_vsc/extension/debugAdapters/bin/OpenDebugAD7', + } + -- <<< end -- <<< -- DAP installer >>> From f26343fc7a3a783790f8103efc9e0b896041e6a0 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 16 Sep 2021 00:06:55 -0700 Subject: [PATCH 16/24] Added usage to todo() --- .zshrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.zshrc b/.zshrc index a4f1173..751a5bd 100644 --- a/.zshrc +++ b/.zshrc @@ -157,6 +157,10 @@ } # an improved way to manage the todo list + # Usage: + # todo -- edit ~/todo + # todo [git command string] -- manage todo for easy syncing, assuming ~/todo is + # a symlink that points to a file in a git repo todo() { ( # subshell to protect against directory changes if [ -z "$@" ];then From 84799e257ce8c1cee21f088b2cdfe83be9fcc517 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 16 Sep 2021 00:40:55 -0700 Subject: [PATCH 17/24] zsh: todo() now changes the working dir --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index 751a5bd..430fc25 100644 --- a/.zshrc +++ b/.zshrc @@ -164,6 +164,7 @@ todo() { ( # subshell to protect against directory changes if [ -z "$@" ];then + cd "$(dirname "$(realpath ~/todo)")" $EDITOR ~/todo else cd "$(dirname "$(realpath ~/todo)")" From 9a47de5f8e431d661c9e51520f9b5677ae235f6d Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 16 Sep 2021 02:16:34 -0700 Subject: [PATCH 18/24] zsh: todo() now has automatic push powers --- .zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 430fc25..1a3f4f1 100644 --- a/.zshrc +++ b/.zshrc @@ -159,15 +159,20 @@ # an improved way to manage the todo list # Usage: # todo -- edit ~/todo + # todo auto -- commit ~/todo and push with message 'todo' # todo [git command string] -- manage todo for easy syncing, assuming ~/todo is # a symlink that points to a file in a git repo todo() { ( # subshell to protect against directory changes + todo_dir="$(dirname "$(realpath ~/todo)")" if [ -z "$@" ];then cd "$(dirname "$(realpath ~/todo)")" $EDITOR ~/todo + elif [ "$@" = 'auto' ];then + cd "$todo_dir" + git commit "$(realpath ~/todo)" -m 'todo' && todo push else - cd "$(dirname "$(realpath ~/todo)")" + cd "$todo_dir" git $@ fi ) From e43cf4aaadc8fa8bb9199000cbc6b7ef873f2f4e Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 16 Sep 2021 02:17:07 -0700 Subject: [PATCH 19/24] Big changes, don't remember all of them One thing is more DAP configuration --- .config/nvim/init.lua | 7 +++-- .config/nvim/lua/lsp.lua | 51 +++++++++++++++++------------------ .config/nvim/lua/other.lua | 20 +++++++++----- .config/nvim/lua/plugins.lua | 4 +-- .config/nvim/lua/settings.lua | 17 +++++++----- 5 files changed, 54 insertions(+), 45 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 6040620..2b9eda8 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -21,12 +21,11 @@ require('plugins') -- [ ] telescope -- [ ] zen-mode.nvim (goyo) -- [ ] status line --- [ ] chadtree keymap --- [ ] lspsaga +-- [X] lspsaga -- [ ] lightspeed.nvim or hop.nvim -- [ ] lightbulb --- [ ] glow.nvim (markdown preview) --- [ ] auto-session +-- [X] glow.nvim (markdown preview) +-- [X] auto-session -- [ ] shade.nvim -- [ ] presence.nvim (discord presence) -- [ ] trouble.nvim diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index ec223d7..376ceea 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -195,24 +195,23 @@ M.lspconfig = function() local opts = { noremap=true, silent=true } -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) - buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) - + buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) + buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) + buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) + buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) + buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) + buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) end -- Use a loop to conveniently call 'setup' on multiple servers and @@ -232,14 +231,14 @@ end -- <<< M.dap = function() -- default keybinds vim.cmd [[ - nnoremap b lua require'dap'.continue() - nnoremap bo lua require'dap'.step_over() - nnoremap bi lua require'dap'.step_into() - nnoremap bO lua require'dap'.step_out() - nnoremap bb lua require'dap'.toggle_breakpoint() - nnoremap bB lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition ')) - nnoremap blp lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message ')) - nnoremap dl lua require'dap'.run_last() + nnoremap d lua require'dap'.continue() + nnoremap dj lua require'dap'.step_over() + nnoremap dl lua require'dap'.step_into() + nnoremap dk lua require'dap'.step_out() + nnoremap dbb lua require'dap'.toggle_breakpoint() + nnoremap dbc lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition ')) + nnoremap dbl lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message ')) + nnoremap dp lua require'dap'.run_last() nnoremap dr lua require'dap'.repl.open() ]] local dap = require('dap') diff --git a/.config/nvim/lua/other.lua b/.config/nvim/lua/other.lua index 142f6c3..34e7939 100644 --- a/.config/nvim/lua/other.lua +++ b/.config/nvim/lua/other.lua @@ -103,19 +103,22 @@ M.gitsigns = function() ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, ['n hs'] = 'lua require"gitsigns".stage_hunk()', - ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', ['n hr'] = 'lua require"gitsigns".reset_hunk()', + + ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', - ['n hR'] = 'lua require"gitsigns".reset_buffer()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', ['n hb'] = 'lua require"gitsigns".blame_line(true)', + ['n hS'] = 'lua require"gitsigns".stage_buffer()', + ['n hR'] = 'lua require"gitsigns".reset_buffer()', ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', -- Text objects - ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', - ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' + ['o ih'] = 'lua require"gitsigns.actions".select_hunk()', + ['x ih'] = 'lua require"gitsigns.actions".select_hunk()' }, watch_index = { interval = 1000, @@ -158,10 +161,15 @@ M.autosession = function() auto_session_enabled = true, auto_save_enabled = false, auto_restore_enabled = true, - auto_session_suppress_dirs = nil + auto_session_suppress_dirs = nil, } require('auto-session').setup(opts) - vim.cmd 'command! SessionSave SaveSession' + -- save some more things. notably options, resize, winpos, and terminal + vim.o.sessionoptions="blank,buffers,curdir,folds,help,options,tabpages,winsize,resize,winpos,terminal" + -- So I don't forget which one it is + vim.cmd 'command! SessionSave SaveSession' + vim.cmd 'command! SessionDelete DeleteSession' + vim.cmd 'command! SessionRestore RestoreSession' end -- <<< return M diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 8e65a67..970edd1 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -45,13 +45,13 @@ return require('packer').startup(function() -- end, 0) -- end, } - use { -- DAP: Debug Adapter Protocol >>> + use { -- DAP: Debug Adapter Protocol "mfussenegger/nvim-dap", config = function() require("lsp").dap() end } - use { + use { -- DAP adapter installer "Pocco81/DAPInstall.nvim", config = function() require("lsp").dapinstall() diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 51743fd..ae9c57f 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -58,21 +58,24 @@ vim.cmd [[ """ Key bindings let mapleader = " " - " *sigh*... + + " *sigh*... command! Q q command! W w command! Wq wq command! WQ wq - " nnoremap ; : - " vnoremap ; : - " Press Alt h to toggle highlighting on/off, and show current value. + + " Press Alt h to toggle highlighting on/off, and show current value. noremap set hlsearch! hlsearch? noremap set spell! spell? - " Escape to enter normal mode in the terminal + + " Escape to enter normal mode in the terminal tnoremap - " Replace with alt S + + " Replace with alt S nnoremap :%s//g - " Move lines around in visual mode with J and K + + " Move lines around in visual mode with J and K vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv From 2a3001ac6d65a3e060aaa9a69071c692ada888e2 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 16 Sep 2021 02:24:30 -0700 Subject: [PATCH 20/24] Moved the vim note to the bottom --- .zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 1a3f4f1..ce247c4 100644 --- a/.zshrc +++ b/.zshrc @@ -1,8 +1,6 @@ #!/bin/zsh # Blake's ZSH config file -# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 - ### Basic shell configuration >>> ### Environment variables >>> { @@ -628,3 +626,5 @@ add-zsh-hook preexec mzc_termsupport_preexec # Optionally source the user's customized .zshrc [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0 +# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 + From 1976e6dd4ad8f37e97e32c836580d53ed3d52c11 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 19 Sep 2021 16:45:25 -0700 Subject: [PATCH 21/24] added dotfiles init script (so you can make your own repo!) --- .local/bin/dotfiles-init.sh | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 .local/bin/dotfiles-init.sh diff --git a/.local/bin/dotfiles-init.sh b/.local/bin/dotfiles-init.sh new file mode 100755 index 0000000..a9dddcd --- /dev/null +++ b/.local/bin/dotfiles-init.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# this will setup a bare git repo for managing dotfiles. You should only run this script once per set of dotfiles. +# credit for this idea and basic script outline goes to: https://www.atlassian.com/git/tutorials/dotfiles + +set -e + +# name the path to the dotfiles repo +DOTFILES_REPO_DIR="$HOME/git/dotfiles" + +# Some colors to spice things up + Cyan="$( tput setaf 6 )" +Green="$( tput setaf 2 )" + NC="$( tput sgr0 )" # No Color + +# check for the git command and exit if it doesn't exist +if ! command -v git > /dev/null;then + echo 'git is not installed or could not be found in $PATH, please install git to proceed' + exit 1 +fi + +# an "alias" for the git command for use by the script +dot() { + git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@" +} + + +mkdir -p "$DOTFILES_REPO_DIR" +if git init --bare "$DOTFILES_REPO_DIR" > /dev/null 2>&1; then + echo "A bare git repository has been initialized at $DOTFILES_REPO_DIR" + echo +else + echo 'git repository initialization failed' + exit +fi +dot config --local status.showUntrackedFiles no +echo "Please add this alias to your shell's init script:" +# looks like this: alias dot="git --git-dir="/path/to/repo" --work-tree=\"$HOME\"" +echo " ${Cyan}alias dot=${Green}\"git --git-dir=\"$DOTFILES_REPO_DIR\" --work-tree=\\\"\$HOME\\\"\"${NC}" +echo "Then, you can use the command '${Cyan}dot ${Green}add ${NC}' to add a given file to the repo" + From 6db788bec2c74a9746250c46bdd8610186cbaf0c Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 19 Sep 2021 16:35:29 -0700 Subject: [PATCH 22/24] zsh: added more usage info to todo() --- .zshrc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index ce247c4..7053fc6 100644 --- a/.zshrc +++ b/.zshrc @@ -154,12 +154,16 @@ done } - # an improved way to manage the todo list + # a simple way to manage your todo list # Usage: - # todo -- edit ~/todo - # todo auto -- commit ~/todo and push with message 'todo' - # todo [git command string] -- manage todo for easy syncing, assuming ~/todo is + # todo -- edit ~/todo + # todo auto -- commit and push ~/todo with message 'todo' + # todo [any git command] -- manage todo for easy syncing, assuming ~/todo is # a symlink that points to a file in a git repo + # + # Suggested use: make a git repo for holding your todo list, then make + # a symlink called 'todo' that points to your todo list in your home directory + # todo() { ( # subshell to protect against directory changes todo_dir="$(dirname "$(realpath ~/todo)")" @@ -168,7 +172,8 @@ $EDITOR ~/todo elif [ "$@" = 'auto' ];then cd "$todo_dir" - git commit "$(realpath ~/todo)" -m 'todo' && todo push + git commit "$(realpath ~/todo)" -m 'todo' + git push else cd "$todo_dir" git $@ @@ -626,5 +631,6 @@ add-zsh-hook preexec mzc_termsupport_preexec # Optionally source the user's customized .zshrc [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0 -# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 +# filetype is sh for language server +# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3 From c1b71e559fac733c5ec95ca5416f913b032696c3 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 20 Sep 2021 02:48:09 -0700 Subject: [PATCH 23/24] nvim: added smooth scrolling and fixed toggleterm --- .config/nvim/init.lua | 4 ++-- .config/nvim/lua/other.lua | 39 +++++++++++++++++++++++++---------- .config/nvim/lua/plugins.lua | 18 +++++----------- .config/nvim/lua/settings.lua | 2 ++ 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2b9eda8..e3a483d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,8 +11,8 @@ require('plugins') -- [x] map A-S to toggle spell check (see logic from hlsearch section in init.vim) -- -- Plugins to Configure --- [ ] toggleterm --- [ ] neoscroll +-- [x] toggleterm +-- [x] neoscroll -- [x] cmp -- [x] lspkind -- [x] lspsignature diff --git a/.config/nvim/lua/other.lua b/.config/nvim/lua/other.lua index 34e7939..0a9e5a0 100644 --- a/.config/nvim/lua/other.lua +++ b/.config/nvim/lua/other.lua @@ -44,15 +44,14 @@ end -- <<< M.toggleterm = function() require("toggleterm").setup{ -- size can be a number or function which is passed the current terminal - -- size = 20 | function(term) - -- if term.direction == "horizontal" then - -- return 15 - -- elseif term.direction == "vertical" then - -- return vim.o.columns * 0.4 - -- end - -- end, + size = function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end, open_mapping = [[]], - toggleterm_terminal_mapping = 't', hide_numbers = true, -- hide the number column in toggleterm buffers shade_filetypes = {}, shade_terminals = true, @@ -60,7 +59,7 @@ M.toggleterm = function() start_in_insert = true, insert_mappings = true, -- whether or not the open mapping applies in insert mode persist_size = true, - direction = 'vertical', -- | 'horizontal' | 'window' | 'float', + direction = 'float', -- vertical, horizontal, window, or float close_on_exit = true, -- close the terminal window when the process exits -- shell = vim.o.shell, -- change the default shell -- This field is only relevant if direction is set to 'float' @@ -69,10 +68,10 @@ M.toggleterm = function() -- see :h nvim_open_win for details on borders however -- the 'curved' border is a custom border type -- not natively supported but implemented in this plugin. - border = 'single', + border = 'curved', -- single, double, shadow, or curved width = 120, height = 32, - winblend = 3, + winblend = 10, -- transparancy highlights = { border = "Normal", background = "Normal", @@ -152,6 +151,24 @@ M.gitsigns = function() } end -- <<< +-- neoscroll for smooth scrolling >>> +M.neoscroll = function() + require('neoscroll').setup({ + -- All these keys will be mapped to their corresponding default scrolling animation + mappings = {'', '', '', '', + '', '', 'zt', 'zz', 'zb',}, + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further + easing_function = 'sine', -- use sine easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, -- Function to run after the scrolling animation ends + }) +end +-- <<< + -- Autosession >>> M.autosession = function() local opts = { diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 970edd1..2b39536 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -73,10 +73,7 @@ return require('packer').startup(function() require('lsp').cmp() end, requires = { -- nvim-cmp sources - -- snippet integration - -- "hrsh7th/cmp-vsnip", - "saadparwaiz1/cmp_luasnip", - + "saadparwaiz1/cmp_luasnip", --luasnip integration "hrsh7th/cmp-path", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", @@ -138,14 +135,9 @@ return require('packer').startup(function() } use { -- Smooth Scrolling "karb94/neoscroll.nvim", - -- disable = not plugin_status.neoscroll, - -- opt = true, - -- config = function() - -- require("plugins.configs.others").neoscroll() - -- end, - -- setup = function() - -- require("core.utils").packer_lazy_load "neoscroll.nvim" - -- end, + config = function() + require('other').neoscroll() + end, } use { -- automatic session management 'rmagatti/auto-session', @@ -153,7 +145,7 @@ return require('packer').startup(function() require('other').autosession() end } - use { + use { -- markdown preview 'ellisonleao/glow.nvim', ft = { 'md', 'markdown', } } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index ae9c57f..e787f58 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -23,6 +23,8 @@ vim.cmd [[ syntax on set redrawtime=1000 " max syntax highlight time set number relativenumber + autocmd InsertEnter * :set norelativenumber " Automatically toggle line numbers + autocmd InsertLeave * :set relativenumber set noerrorbells set encoding=UTF-8 set cursorline From e34b962d2be7352d55b0e50472cfa94b6392e1d9 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 20 Sep 2021 02:55:01 -0700 Subject: [PATCH 24/24] nvim: added a note to remove luasnip it does not work on my server for some reason --- .config/nvim/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index e3a483d..9d5204f 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -9,6 +9,7 @@ require('plugins') -- -- Misc: -- [x] map A-S to toggle spell check (see logic from hlsearch section in init.vim) +-- [ ] remove luasnip -- -- Plugins to Configure -- [x] toggleterm