-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
64 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,7 @@ | ||
local util = require("util") | ||
|
||
util.cowboy() | ||
|
||
local nav = { | ||
h = "Left", | ||
j = "Down", | ||
k = "Up", | ||
l = "Right", | ||
} | ||
|
||
local function navigate(dir) | ||
return function() | ||
local win = vim.api.nvim_get_current_win() | ||
vim.cmd.wincmd(dir) | ||
local pane = vim.env.WEZTERM_PANE | ||
if vim.system and pane and win == vim.api.nvim_get_current_win() then | ||
local pane_dir = nav[dir] | ||
vim.system({ "wezterm", "cli", "activate-pane-direction", pane_dir }, { text = true }, function(p) | ||
if p.code ~= 0 then | ||
vim.notify( | ||
"Failed to move to pane " .. pane_dir .. "\n" .. p.stderr, | ||
vim.log.levels.ERROR, | ||
{ title = "Wezterm" } | ||
) | ||
end | ||
end) | ||
end | ||
end | ||
end | ||
|
||
util.set_user_var("IS_NVIM", true) | ||
|
||
-- Move to window using the movement keys | ||
for key, dir in pairs(nav) do | ||
vim.keymap.set("n", "<" .. dir .. ">", navigate(key)) | ||
vim.keymap.set("n", "<C-" .. key .. ">", navigate(key)) | ||
end | ||
util.wezterm() | ||
|
||
-- change word with <c-c> | ||
vim.keymap.set("n", "<C-c>", "<cmd>normal! ciw<cr>a") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.