From 7cf861bbbb85231b450dc3426845c739ede89e21 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 13 Apr 2024 12:49:18 -0700 Subject: [PATCH 1/3] change location of nvim vimrc --- init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.vim b/init.vim index f07bdc8..15fcfa7 100644 --- a/init.vim +++ b/init.vim @@ -1,4 +1,4 @@ -source /Users/benhammel/.vimrc +source /home/bdhammel/.vimrc "============================================================================= " Set secure last so that if any part is unset above, it is corrected now From 95eca4422d710c824f746a27d7a2492dd4c68332 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 24 Aug 2024 13:46:41 -0700 Subject: [PATCH 2/3] minor changes --- bash_aliases | 1 + makesymlinks.sh => setup.sh | 0 vimrc | 5 +++-- 3 files changed, 4 insertions(+), 2 deletions(-) rename makesymlinks.sh => setup.sh (100%) diff --git a/bash_aliases b/bash_aliases index 9888789..7a66e3c 100644 --- a/bash_aliases +++ b/bash_aliases @@ -89,3 +89,4 @@ alias vim='nvim' alias ovim='vim $(fzf)' alias goto='cd "$(fzf || echo '.')"' alias cdh='cd "$(dirs -p | fzf)"' +alias f='cd $(fdfind --type d --hidden --exclude .git --exclude node_module --exclude .cache --exclude .npm --exclude .mozilla --exclude .meteor --exclude .nv | fzf)' diff --git a/makesymlinks.sh b/setup.sh similarity index 100% rename from makesymlinks.sh rename to setup.sh diff --git a/vimrc b/vimrc index f597963..7d5f363 100644 --- a/vimrc +++ b/vimrc @@ -14,7 +14,8 @@ Plug 'altercation/vim-colors-solarized' Plug 'itchyny/lightline.vim' Plug 'christoomey/vim-tmux-navigator' -Plug 'ctrlpvim/ctrlp.vim' +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' Plug 'ojroques/vim-oscyank', {'branch': 'main'} Plug 'tpope/vim-surround' @@ -28,7 +29,7 @@ Plug 'vim-scripts/indentpython.vim' Plug 'dense-analysis/ale' if using_neovim - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + " Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " Plug 'github/copilot.vim' endif From c53e41bd45ad645298573695546f801ca490e980 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 2 Oct 2024 10:20:12 -0700 Subject: [PATCH 3/3] lots of changes for some reason --- README.md | 8 ++--- aliases | 3 +- nvim/lua/handlers/hover.lua | 5 +++ nvim/lua/plugins/copilot.lua | 3 ++ nvim/lua/plugins/iron.lua | 58 ++++++++++++++++++++++++++++++++ nvim/lua/plugins/lsp.lua | 2 +- nvim/lua/plugins/oscyank.lua | 65 ++++++++++++++++++++++-------------- nvim/lua/settings.lua | 12 +++++++ tmux.conf | 4 +-- tmux.conf_3 | 9 ++--- 10 files changed, 132 insertions(+), 37 deletions(-) create mode 100644 nvim/lua/plugins/copilot.lua create mode 100644 nvim/lua/plugins/iron.lua diff --git a/README.md b/README.md index 9322ecf..1510868 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,9 @@ $ ln -s dotfiles/vim .vim ## Installing packages w/o sudo You can install into two different user `bin` locations - - `/usr/bin` - `~/bin` -ensure `/usr/bin` is exported into `PATH` +ensure `~/bin` is exported into `PATH` ``` cd /usr/bin @@ -30,10 +29,11 @@ ensure `/usr/bin` is exported into `PATH` Packages to install - [ripgrep](https://github.com/BurntSushi/ripgrep/releases) - - [fzf] - - [fd-find] + - [fzf](https://github.com/junegunn/fzf/releases) + - [fd-find](https://github.com/sharkdp/fd/releases) - [yank](https://github.com/mptre/yank/releases) - [bat] + - [tmux](https://github.com/nelsonenzo/tmux-appimage/releases) ### Install NVIM diff --git a/aliases b/aliases index 72289ff..5bb71d0 100644 --- a/aliases +++ b/aliases @@ -30,11 +30,12 @@ alias h='history' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' +alias fd='fdfind' alias web_finder="python3 -m http.server --bind $HOSTNAME" -alias yank='yank | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed "s/\x0f//g" | ~/dotfiles/osc52.sh' +alias yank='yank-cli | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed "s/\x0f//g" | ~/dotfiles/osc52.sh' alias vim='nvim' alias vimdiff='nvim -d' diff --git a/nvim/lua/handlers/hover.lua b/nvim/lua/handlers/hover.lua index faf414a..5e8c7bc 100644 --- a/nvim/lua/handlers/hover.lua +++ b/nvim/lua/handlers/hover.lua @@ -75,7 +75,12 @@ M.setup = function() api.nvim_buf_set_lines(buf, 0, -1, true, contents) end api.nvim_win_set_buf(0, buf) + + -- Set buffer options + vim.bo[buf].modifiable = false + vim.bo[buf].bufhidden = 'wipe' end + end return M diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..1ffa970 --- /dev/null +++ b/nvim/lua/plugins/copilot.lua @@ -0,0 +1,3 @@ +return { + "github/copilot.vim" +} diff --git a/nvim/lua/plugins/iron.lua b/nvim/lua/plugins/iron.lua new file mode 100644 index 0000000..a23999d --- /dev/null +++ b/nvim/lua/plugins/iron.lua @@ -0,0 +1,58 @@ +return { + "Vigemus/iron.nvim", + config = function() + local iron = require("iron.core") + + iron.setup { + config = { + -- Whether a repl should be discarded or not + scratch_repl = true, + -- Your repl definitions come here + repl_definition = { + sh = { + -- Can be a table or a function that + -- returns a table (see below) + command = {"zsh"} + }, + python = { + command = { "ipython" }, -- or { "ipython", "--no-autoindent" } + format = require("iron.fts.common").bracketed_paste_python + } + }, + -- How the repl window will be displayed + -- See below for more information + repl_open_cmd = require('iron.view').bottom(40), + }, + -- Iron doesn't set keymaps by default anymore. + -- You can set them here or manually add keymaps to the functions in iron.core + keymaps = { + send_motion = "sc", + visual_send = "sc", + send_file = "sf", + send_line = "sl", + send_paragraph = "sp", + send_until_cursor = "su", + send_mark = "sm", + mark_motion = "mc", + mark_visual = "mc", + remove_mark = "md", + cr = "s", + interrupt = "s", + exit = "sq", + clear = "cl", + }, + -- If the highlight is on, you can change how it looks + -- For the available options, check nvim_set_hl + highlight = { + italic = true + }, + ignore_blank_lines = true, -- ignore blank lines when sending visual select lines + } + + -- iron also has a list of commands, see :h iron-commands for all available commands + vim.keymap.set('n', 'rs', 'IronRepl') + vim.keymap.set('n', 'rr', 'IronRestart') + vim.keymap.set('n', 'rf', 'IronFocus') + vim.keymap.set('n', 'rh', 'IronHide') + end +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index c372f4b..e7143f0 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -110,7 +110,7 @@ return { require('lspconfig').pyright.setup({ settings = { python = { - pythonPath = '/opt/sambanova/bin/python', + -- pythonPath = '/opt/sambanova/bin/python', analysis = { autoSearchPaths = true, typeCheckingMode = "off", diff --git a/nvim/lua/plugins/oscyank.lua b/nvim/lua/plugins/oscyank.lua index 77925eb..dfcf11c 100644 --- a/nvim/lua/plugins/oscyank.lua +++ b/nvim/lua/plugins/oscyank.lua @@ -1,30 +1,45 @@ -- Note: Neovim 10.0+ supports OSC52 natively, there's no need for this plugin. -- Shares a SSH vim's clipboard with local clipboard. return { - 'ojroques/nvim-osc52', - branch = main, - lazy = false, - config = function() - vim.keymap.set('n', 'c', require('osc52').copy_operator, {expr = true}) - vim.keymap.set('n', 'cc', 'c_', {remap = true}) - vim.keymap.set('v', 'c', require('osc52').copy_visual) - - local function copy(lines, _) - require('osc52').copy(table.concat(lines, '\n')) -end - -local function paste() - return {vim.fn.split(vim.fn.getreg(''), '\n'), vim.fn.getregtype('')} -end - -vim.g.clipboard = { - name = 'osc52', - copy = {['+'] = copy, ['*'] = copy}, - paste = {['+'] = paste, ['*'] = paste}, +-- 'ojroques/nvim-osc52', +-- branch = main, +-- lazy = false, +-- config = function() +-- require('osc52').setup({ +-- tmux_passthrough = true, +-- }) +-- vim.keymap.set('n', 'c', require('osc52').copy_operator, {expr = true}) +-- vim.keymap.set('n', 'cc', 'c_', {remap = true}) +-- vim.keymap.set('v', 'c', require('osc52').copy_visual) +-- +-- local function copy() +-- if vim.v.event.operator == 'y' then +-- require('osc52').copy_register('*') +-- end +-- end +-- +-- vim.api.nvim_create_autocmd('TextYankPost', {callback = copy}) +-- +-- -- local function copy(lines, _) +-- -- require('osc52').copy(table.concat(lines, '\n')) +-- -- end +-- +-- -- local function paste() +-- -- return {vim.fn.split(vim.fn.getreg(''), '\n'), vim.fn.getregtype('')} +-- -- end +-- +-- -- vim.g.clipboard = { +-- -- name = 'osc52', +-- -- copy = {['+'] = copy, ['*'] = copy}, +-- -- paste = {['+'] = paste, ['*'] = paste}, +-- -- } +-- +-- -- Now the '+' register will copy to system clipboard using OSC52 +-- -- vim.keymap.set('n', 'c', '"+y') +-- -- vim.keymap.set('n', 'cc', '"+yy') +-- +-- -- Use system clipboard for copy-pasting +-- vim.opt.clipboard:append({'unnamed', 'unnamedplus'}) +-- end } --- Now the '+' register will copy to system clipboard using OSC52 -vim.keymap.set('n', 'c', '"+y') -vim.keymap.set('n', 'cc', '"+yy') - end -} diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index fb23091..c4a1868 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -13,6 +13,18 @@ vim.opt.swapfile = false vim.opt.autoread = true -- Use system clipboard for copy-pasting +vim.g.clipboard = { + name = 'OSC 52', + copy = { + ['+'] = require('vim.ui.clipboard.osc52').copy('+'), + ['*'] = require('vim.ui.clipboard.osc52').copy('*'), + }, + paste = { + ['+'] = require('vim.ui.clipboard.osc52').paste('+'), + ['*'] = require('vim.ui.clipboard.osc52').paste('*'), + }, +} + vim.opt.clipboard:append({'unnamed', 'unnamedplus'}) -- Tab and indentation settings diff --git a/tmux.conf b/tmux.conf index 661a055..1f8cce8 100644 --- a/tmux.conf +++ b/tmux.conf @@ -4,7 +4,7 @@ unbind-key C-a bind-key C-a send-prefix set -g base-index 1 -set-option -g default-terminal tmux-256color +set-option -g default-terminal xterm-256color set-option -g history-limit 5000 # Easy config reload @@ -61,7 +61,7 @@ bind-key T previous-window set -g allow-passthrough on set -g set-clipboard on -set -as terminal-overrides ',tmux*:Ms=\\E]52;%p1%s;%p2%s\\007' +set -as terminal-overrides ',xterm*:Ms=\\E]52;%p1%s;%p2%s\\007' bind-key [ copy-mode bind-key ] paste-buffer diff --git a/tmux.conf_3 b/tmux.conf_3 index 31971ca..7ede3d3 100644 --- a/tmux.conf_3 +++ b/tmux.conf_3 @@ -4,7 +4,7 @@ unbind-key C-a bind-key C-a send-prefix set -g base-index 1 -set-option -g default-terminal tmux-256color +set-option -g default-terminal xterm-256color set-option -g history-limit 5000 # Easy config reload @@ -61,15 +61,16 @@ bind-key T previous-window # Ms modifies OSC 52 clipboard handling to work with mosh, see # https://gist.github.com/yudai/95b20e3da66df1b066531997f982b57b -set -ag terminal-overrides "vte*:XT:Ms=\\E]52;c;%p2%s\\7,xterm*:XT:Ms=\\E]52;c;%p2%s\\7" +# set -ag terminal-overrides "vte*:XT:Ms=\\E]52;c;%p2%s\\7,xterm*:XT:Ms=\\E]52;c;%p2%s\\7" +# set-option -ag terminal-overrides ",tmux-256color:Ms=\\E]52;c%p1%.0s;%p2%s\\7" +set-option -ag terminal-overrides ",xterm-256color:Ms=\\E]52;c;%p1%s%p2%s\\7" # enable OSC 52 clipboard # https://medium.freecodecamp.org/tmux-in-practice-integration-with-system-clipboard-bcd72c62ff7b set -g set-clipboard on -set-window-option -g allow-passthrough on bind-key [ copy-mode -bind-key ] paste-buffer +bind-key ] paste-buffer -p # Setup 'v' to begin selection as in Vim unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection