Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion aliases
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion init.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions nvim/lua/handlers/hover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion nvim/lua/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
return {
"github/copilot.vim",
"github/copilot.vim"
}
58 changes: 58 additions & 0 deletions nvim/lua/plugins/iron.lua
Original file line number Diff line number Diff line change
@@ -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 = "<space>sc",
visual_send = "<space>sc",
send_file = "<space>sf",
send_line = "<space>sl",
send_paragraph = "<space>sp",
send_until_cursor = "<space>su",
send_mark = "<space>sm",
mark_motion = "<space>mc",
mark_visual = "<space>mc",
remove_mark = "<space>md",
cr = "<space>s<cr>",
interrupt = "<space>s<space>",
exit = "<space>sq",
clear = "<space>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', '<space>rs', '<cmd>IronRepl<cr>')
vim.keymap.set('n', '<space>rr', '<cmd>IronRestart<cr>')
vim.keymap.set('n', '<space>rf', '<cmd>IronFocus<cr>')
vim.keymap.set('n', '<space>rh', '<cmd>IronHide<cr>')
end
}
65 changes: 40 additions & 25 deletions nvim/lua/plugins/oscyank.lua
Original file line number Diff line number Diff line change
@@ -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', '<leader>c', require('osc52').copy_operator, {expr = true})
vim.keymap.set('n', '<leader>cc', '<leader>c_', {remap = true})
vim.keymap.set('v', '<leader>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', '<leader>c', require('osc52').copy_operator, {expr = true})
-- vim.keymap.set('n', '<leader>cc', '<leader>c_', {remap = true})
-- vim.keymap.set('v', '<leader>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', '<leader>c', '"+y')
-- -- vim.keymap.set('n', '<leader>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', '<leader>c', '"+y')
vim.keymap.set('n', '<leader>cc', '"+yy')
end
}
12 changes: 12 additions & 0 deletions nvim/lua/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tmux.conf_3
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down