Neovim init.lua
This commit is contained in:
@ -2,13 +2,13 @@ status is-interactive; or return
|
|||||||
|
|
||||||
status is-login; and abbr H Hyprland
|
status is-login; and abbr H Hyprland
|
||||||
|
|
||||||
abbr l la
|
|
||||||
abbr m mkdir
|
abbr m mkdir
|
||||||
abbr o open
|
abbr o open
|
||||||
abbr t trash
|
abbr t trash
|
||||||
# abbr m mpv
|
# abbr m mpv
|
||||||
abbr mm -- mpv --shuffle \$XDG_MUSIC_DIR
|
abbr mm -- mpv --shuffle \$XDG_MUSIC_DIR
|
||||||
|
|
||||||
|
abbr l lazygit
|
||||||
abbr g git
|
abbr g git
|
||||||
# abbr dots -- git --git-dir \~/.dotfiles/ --work-tree \~
|
# abbr dots -- git --git-dir \~/.dotfiles/ --work-tree \~
|
||||||
abbr gl git log
|
abbr gl git log
|
||||||
@ -18,8 +18,9 @@ abbr gs git status
|
|||||||
abbr gcl git clone
|
abbr gcl git clone
|
||||||
abbr gco git checkout
|
abbr gco git checkout
|
||||||
|
|
||||||
|
function __last_hist_item
|
||||||
function __last_hist_item; printf $history[1]; end
|
printf $history[1]
|
||||||
|
end
|
||||||
abbr !! -p anywhere -f __last_hist_item
|
abbr !! -p anywhere -f __last_hist_item
|
||||||
|
|
||||||
function __find_editor --description 'Edit with edit-in-kitty when in ssh'
|
function __find_editor --description 'Edit with edit-in-kitty when in ssh'
|
||||||
@ -42,5 +43,7 @@ function __multidot --description 'Use .... instead of ../../../'
|
|||||||
end
|
end
|
||||||
abbr multidot -r '\.\.\.+$' -p anywhere --set-cursor -f __multidot
|
abbr multidot -r '\.\.\.+$' -p anywhere --set-cursor -f __multidot
|
||||||
|
|
||||||
function __multicd; echo cd (__multidot $argv); end
|
function __multicd
|
||||||
|
echo cd (__multidot $argv)
|
||||||
|
end
|
||||||
abbr multicd -r '^\.\.+$' --set-cursor -f __multicd
|
abbr multicd -r '^\.\.+$' --set-cursor -f __multicd
|
||||||
|
@ -20,7 +20,7 @@ rulers = [80, 100]
|
|||||||
bufferline = "multiple" # never, always, multiple
|
bufferline = "multiple" # never, always, multiple
|
||||||
color-modes = false # mode indicator color
|
color-modes = false # mode indicator color
|
||||||
insert-final-newline = true # POSIX lines finish with \n
|
insert-final-newline = true # POSIX lines finish with \n
|
||||||
popup-border = "none" # popup, menu, all, none
|
popup-border = "all" # popup, menu, all, none
|
||||||
jump-label-alphabet = "tneiouykhsrafwvd"
|
jump-label-alphabet = "tneiouykhsrafwvd"
|
||||||
end-of-line-diagnostics = "hint" # disable, error, warning, info, hint
|
end-of-line-diagnostics = "hint" # disable, error, warning, info, hint
|
||||||
|
|
||||||
@ -106,25 +106,27 @@ x = "extend_line"
|
|||||||
tab = "extend_parent_node_end"
|
tab = "extend_parent_node_end"
|
||||||
S-tab = "extend_parent_node_start"
|
S-tab = "extend_parent_node_start"
|
||||||
";" = ["collapse_selection", "normal_mode"]
|
";" = ["collapse_selection", "normal_mode"]
|
||||||
V = "extend_to_line_end"
|
|
||||||
|
V = ["extend_to_line_bounds", "trim_selections"]
|
||||||
|
D = ["ensure_selections_forward", "extend_to_line_end"]
|
||||||
|
|
||||||
[keys.normal]
|
[keys.normal]
|
||||||
x = "extend_line"
|
x = "extend_line"
|
||||||
"=" = ":format"
|
"=" = ":format"
|
||||||
"A-=" = "format_selections"
|
"A-=" = "format_selections"
|
||||||
|
|
||||||
C-space = "signature_help"
|
V = ["extend_to_line_bounds", "trim_selections"]
|
||||||
space.'.' = ":config-reload"
|
|
||||||
|
|
||||||
tab = "move_parent_node_end"
|
|
||||||
S-tab = "move_parent_node_start"
|
|
||||||
|
|
||||||
V = ["goto_first_nonwhitespace", "extend_to_line_end"]
|
|
||||||
D = ["ensure_selections_forward", "extend_to_line_end"]
|
D = ["ensure_selections_forward", "extend_to_line_end"]
|
||||||
|
|
||||||
L = "goto_next_buffer"
|
L = "goto_next_buffer"
|
||||||
H = "goto_previous_buffer"
|
H = "goto_previous_buffer"
|
||||||
|
|
||||||
|
C-space = "signature_help"
|
||||||
|
|
||||||
|
tab = "move_parent_node_end"
|
||||||
|
S-tab = "move_parent_node_start"
|
||||||
|
|
||||||
|
# C-q = "wclose"
|
||||||
C-k = "jump_view_up"
|
C-k = "jump_view_up"
|
||||||
C-h = "jump_view_left"
|
C-h = "jump_view_left"
|
||||||
C-j = "jump_view_down"
|
C-j = "jump_view_down"
|
||||||
@ -140,6 +142,14 @@ A-k = [
|
|||||||
A-J = ["extend_to_line_bounds", "yank", "paste_after"]
|
A-J = ["extend_to_line_bounds", "yank", "paste_after"]
|
||||||
A-K = ["extend_to_line_bounds", "yank", "paste_before"]
|
A-K = ["extend_to_line_bounds", "yank", "paste_before"]
|
||||||
|
|
||||||
|
[keys.normal.space]
|
||||||
|
'.' = ":config-reload"
|
||||||
|
e = ":reload"
|
||||||
|
E = ":reload-all"
|
||||||
|
q = ":buffer-close"
|
||||||
|
Q = ":buffer-close-all"
|
||||||
|
o = ":buffer-close-others"
|
||||||
|
n = "file_picker_in_current_buffer_directory"
|
||||||
|
|
||||||
# Toggle
|
# Toggle
|
||||||
[keys.normal.space.t]
|
[keys.normal.space.t]
|
||||||
|
@ -308,8 +308,8 @@ map ctrl+shift+alt+up scroll_home
|
|||||||
map kitty_mod+z scroll_to_prompt -1
|
map kitty_mod+z scroll_to_prompt -1
|
||||||
map kitty_mod+x scroll_to_prompt 1
|
map kitty_mod+x scroll_to_prompt 1
|
||||||
map kitty_mod+k show_scrollback
|
map kitty_mod+k show_scrollback
|
||||||
map kitty_mod+b show_last_visited_command_output
|
map kitty_mod+b show_last_non_empty_command_output
|
||||||
map ctrl+alt+b show_last_non_empty_command_output
|
map ctrl+alt+b show_last_visited_command_output
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Window management {{{
|
# Window management {{{
|
||||||
|
26
.config/nvim/init.lua
Normal file
26
.config/nvim/init.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
require "utils" -- global functions here
|
||||||
|
require "options"
|
||||||
|
require "autocmds"
|
||||||
|
vim.schedule_wrap(require) "mappings" -- Mappings hog startup time.
|
||||||
|
|
||||||
|
-- Stop loading if opening an encrypted file
|
||||||
|
for _, arg in ipairs(vim.v.argv) do
|
||||||
|
local ext = arg:sub(-4);
|
||||||
|
if ext == ".gpg" or ext == ".asc" then
|
||||||
|
require "gpg"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system("git clone --filter=blob:none https://github.com/folke/lazy.nvim.git --branch=stable " .. lazypath)
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Dynamically merge lua/plugins{,/*}.lua to the main plugin spec
|
||||||
|
require("lazy").setup("plugins", {
|
||||||
|
defaults = { lazy = true },
|
||||||
|
change_detection = { notify = false },
|
||||||
|
ui = { border = vim.g.border }
|
||||||
|
})
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -37,6 +37,7 @@
|
|||||||
.config/nvim/*
|
.config/nvim/*
|
||||||
!.config/nvim/lua/
|
!.config/nvim/lua/
|
||||||
!.config/nvim/after
|
!.config/nvim/after
|
||||||
|
!.config/nvim/init.lua
|
||||||
!.config/nvim/README.md
|
!.config/nvim/README.md
|
||||||
!.config/nvim/lazy-lock.json
|
!.config/nvim/lazy-lock.json
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user