Compare commits

...

7 Commits

Author SHA1 Message Date
9c7237c7e1 neovim - update zoom-toggle 2023-04-18 19:18:30 -05:00
ce6dca9733 neovim - lua lsp name fix 2023-04-18 19:17:55 -05:00
6c0639068d neovim - neovim 0.9.0 updates 2023-04-18 19:17:20 -05:00
df8d793467 neovim - utils namespace updates 2023-04-18 19:16:52 -05:00
0d22d7fa46 neovim - paredit smartjump enable 2023-04-18 19:15:30 -05:00
fa7904e131 neovim - project plugin and telescope updates 2023-04-18 19:14:25 -05:00
9a302cb6c2 neovim - smartsplits plugin 2023-04-18 19:13:50 -05:00
10 changed files with 128 additions and 61 deletions

View File

@@ -79,28 +79,29 @@
; Trim trailing Whitespace in current line
(util.lnnoremap :tw "<C-U>.s/\\s\\+$//ge<CR>:nohlsearch<Enter>/<BS>")
;; (noremap :n :<C-A-l> ":echo \"test\"\n")
; Window switching
; ˙ -> alt-h
; ∆ -> alt-j
; ˚ -> alt-k
; ¬ -> alt-l
;; Terminal mode
(noremap :t "˙" "<c-\\><c-n><c-w>h")
(noremap :t "∆" "<c-\\><c-n><c-w>j")
(noremap :t "˚" "<c-\\><c-n><c-w>k")
(noremap :t "¬" "<c-\\><c-n><c-w>l")
;; Insert mode:
(noremap :i "˙" :<Esc><c-w>h)
(noremap :i "∆" :<Esc><c-w>j)
(noremap :i "˚" :<Esc><c-w>k)
(noremap :i "¬" :<Esc><c-w>l)
;; Visual mode:
(noremap :v "˙" :<Esc><c-w>h)
(noremap :v "∆" :<Esc><c-w>j)
(noremap :v "˚" :<Esc><c-w>k)
(noremap :v "¬" :<Esc><c-w>l)
;; Normal mode:
(noremap :n "˙" :<c-w>h)
(noremap :n "∆" :<c-w>j)
(noremap :n "˚" :<c-w>k)
(noremap :n "¬" :<c-w>l)
;; (noremap :t "˙" "<c-\\><c-n><c-w>h")
;; (noremap :t "∆" "<c-\\><c-n><c-w>j")
;; (noremap :t "˚" "<c-\\><c-n><c-w>k")
;; (noremap :t "¬" "<c-\\><c-n><c-w>l")
;; ;; Insert mode:
;; (noremap :i "˙" :<Esc><c-w>h)
;; (noremap :i "∆" :<Esc><c-w>j)
;; (noremap :i "˚" :<Esc><c-w>k)
;; (noremap :i "¬" :<Esc><c-w>l)
;; ;; Visual mode:
;; (noremap :v "˙" :<Esc><c-w>h)
;; (noremap :v "∆" :<Esc><c-w>j)
;; (noremap :v "˚" :<Esc><c-w>k)
;; (noremap :v "¬" :<Esc><c-w>l)
;; ;; Normal mode:
;; (noremap :n "˙" :<c-w>h)
;; (noremap :n "∆" :<c-w>j)
;; (noremap :n "˚" :<c-w>k)
;; (noremap :n "¬" :<c-w>l)

View File

@@ -3,4 +3,4 @@
(mason.setup {:ui {:icons {:package_installed "✓"}}})
(mason-lspconf.setup {:ensure_installed [:sumneko_lua]})
(mason-lspconf.setup {:ensure_installed [:lua_ls]})

View File

@@ -7,6 +7,8 @@
ts-utils nvim-treesitter.ts_utils
languagetree vim.treesitter.languagetree}})
(set nvim.g.paredit_smartjump 1)
(defn list-member? [xs x] (a.some #(= x $1) (a.vals xs)))
(defn bool->int [bool] (if bool 1 0))

View File

@@ -0,0 +1,27 @@
(module dotfiles.plugin.smartsplits
{autoload {nvim aniseed.nvim
a aniseed.core
smart-splits smart-splits
;; util dotfiles.util
}})
(smart-splits.setup)
;; recommended mappings
;; resizing splits
;; these keymaps will also accept a range,
;; for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
(vim.keymap.set :n :<M-S-h> smart-splits.resize_left)
(vim.keymap.set :n :<M-S-j> smart-splits.resize_down)
(vim.keymap.set :n :<M-S-k> smart-splits.resize_up)
(vim.keymap.set :n :<M-S-l> smart-splits.resize_right)
;; moving between splits
(vim.keymap.set :n :<M-h> smart-splits.move_cursor_left)
(vim.keymap.set :n :<M-j> smart-splits.move_cursor_down)
(vim.keymap.set :n :<M-k> smart-splits.move_cursor_up)
(vim.keymap.set :n :<M-l> smart-splits.move_cursor_right)
;; swapping buffers between windows
(vim.keymap.set :n :<leader><leader>h smart-splits.swap_buf_left)
(vim.keymap.set :n :<leader><leader>j smart-splits.swap_buf_down)
(vim.keymap.set :n :<leader><leader>k smart-splits.swap_buf_up)
(vim.keymap.set :n :<leader><leader>l smart-splits.swap_buf_right)

View File

@@ -1,5 +1,8 @@
(module dotfiles.plugin.telescope
{autoload {nvim aniseed.nvim util dotfiles.util telescope telescope}})
{autoload {nvim aniseed.nvim
util dotfiles.util
telescope telescope
project-nvim project_nvim}})
(def vimgrep_arguments [:ag
:--nocolor
@@ -11,23 +14,29 @@
:--hidden
; "--skip-vcs-ignores"
; "-g" "!.git/"
:--ignore
:.git
:--follow])
(telescope.load_extension :projects)
(telescope.setup {:defaults {: vimgrep_arguments}
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}})
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}
:extensions {:projects {:projects {}}}})
(util.lnnoremap :fc "Telescope commands")
(util.lnnoremap :fC "Telescope command_history")
(util.lnnoremap :ff "Telescope git_files hidden=true")
(util.lnnoremap :f- "Telescope find_files")
(util.lnnoremap :fg "Telescope live_grep")
(util.lnnoremap "*" "Telescope grep_string")
(util.lnnoremap :fb "Telescope buffers")
(util.lnnoremap :fd "Telescope diagnostics")
(util.lnnoremap :fH "Telescope help_tags")
(util.lnnoremap :fh "Telescope oldfiles")
(util.lnnoremap :fp "Telescope projects")
(util.lnnoremap :fm "Telescope keymaps")
(util.lnnoremap :fM "Telescope marks")
(util.lnnoremap :fh "Telescope oldfiles")
(util.lnnoremap :ft "Telescope filetypes")
(util.lnnoremap :fc "Telescope commands")
(util.lnnoremap :fC "Telescope command_history")
(util.lnnoremap :fq "Telescope quickfix")
(util.lnnoremap :fl "Telescope loclist")
(util.lnnoremap :fsi "Telescope lsp_implementations")

View File

@@ -21,6 +21,7 @@
(def- packages {:Olical/aniseed {}
:Olical/conjure {:mod :conjure}
:Olical/fennel.vim {}
:ahmedkhalf/project.nvim {}
:airblade/vim-gitgutter {}
:clojure-vim/vim-jack-in {}
:dhruvasagar/vim-table-mode {}
@@ -52,6 +53,7 @@
:lifepillar/vim-solarized8 {}
:lukas-reineke/headlines.nvim {:mod :headlines}
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:mrjones2014/smart-splits.nvim {:mod :smartsplits}
:neovim/nvim-lspconfig {:mod :lspconfig}
:norcalli/nvim-colorizer.lua {:mod :colorizer}
:nvim-orgmode/orgmode {:mod :orgmode}

View File

@@ -5,7 +5,7 @@
(: tree :root)))
(defn make-query [lang query-string]
(let [query (vim.treesitter.parse_query lang "(headline (stars) @stars)")]
(let [query (vim.treesitter.query.parse lang "(headline (stars) @stars)")]
(fn [bufnr]
(let [root-node (root bufnr lang)
iter-captures (query.iter_captures query root-node bufnr 0 -1)]

View File

@@ -1,23 +1,21 @@
(module dotfiles.util
{autoload
{a aniseed.core}
require
{nvim aniseed.nvim}})
(module dotfiles.util {autoload {a aniseed.core} require {nvim aniseed.nvim}})
(defn noremap [mode from to opts]
(let [map-opts {:noremap true :silent true}
to (.. ":" to "<cr>")
to (.. ":" to :<cr>)
buff-num (a.get opts :buff-num)]
(if (or (a.get opts :local?) buff-num)
(nvim.buf_set_keymap (or buff-num 0) mode from to map-opts)
(nvim.set_keymap mode from to map-opts))))
(defn nnoremap [from to opts]
(noremap :n from to opts))
(defn nnoremap [from to opts] (noremap :n from to opts))
(defn lnnoremap [from to]
(nnoremap (.. "<leader>" from) to))
(defn tnoremap [from to opts] (noremap :t from to opts))
(defn lvnoremap [from to opts]
(noremap :v (.. "<leader>" from) to opts))
(defn inoremap [from to opts] (noremap :i from to opts))
(defn vnoremap [from to opts] (noremap :v from to opts))
(defn lnnoremap [from to] (nnoremap (.. :<leader> from) to))
(defn lvnoremap [from to opts] (noremap :v (.. :<leader> from) to opts))

View File

@@ -1,16 +1,13 @@
(module dotfiles.zoom-toggle
{autoload
{a aniseed.core}
require
{anenv aniseed.env
{autoload {a aniseed.core}
require {anenv aniseed.env
nvim aniseed.nvim
nu aniseed.nvim.util
u dotfiles.util}})
(var unzoom! nil)
(defn zoom-toggle []
(if unzoom!
(defn zoom-toggle [] (if unzoom!
(do
(nvim.command unzoom!)
(set unzoom! nil))
@@ -19,6 +16,6 @@
(nvim.ex.resize)
(nvim.ex.vertical :resize))))
(nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false})
(u.nnoremap :<C-W>z ":call ZoomToggle()<CR>")
(u.tnoremap :t "Ω" "<c-\\><c-n>:call ZoomToggle()<CR>")

View File

@@ -1,6 +1,9 @@
set -g prefix C-a
unbind C-b
set -g xterm-keys on
set -s extended-keys on
set -g history-file ~/.tmux_history
set -s escape-time 1
@@ -58,3 +61,31 @@ set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
set-option -g focus-events on
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-S-h if-shell "$is_vim" 'send-keys M-S-h' 'resize-pane -L 3'
bind-key -n M-S-j if-shell "$is_vim" 'send-keys M-S-j' 'resize-pane -D 3'
bind-key -n M-S-k if-shell "$is_vim" 'send-keys M-S-k' 'resize-pane -U 3'
bind-key -n M-S-l if-shell "$is_vim" 'send-keys M-S-l' 'resize-pane -R 3'
bind-key -n M-h if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n M-j if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n M-k if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n M-l if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'M-S-h' select-pane -L
bind-key -T copy-mode-vi 'M-S-j' select-pane -D
bind-key -T copy-mode-vi 'M-S-k' select-pane -U
bind-key -T copy-mode-vi 'M-S-l' select-pane -R
bind-key -T copy-mode-vi 'M-S-\' select-pane -l