Skip to content

Commit

Permalink
focus on splits
Browse files Browse the repository at this point in the history
  • Loading branch information
fedemengo committed Oct 3, 2023
1 parent f7337c6 commit 3f99154
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fnl/mapping.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
(vim.api.nvim_buf_set_text 0 (-- sr) 0 (-- er) (length line)
[newline])))))

(fn toggle-wrap []
(let [has-wrap (. vim.wo :wrap)]
(if has-wrap
(vim.cmd "windo set nowrap")
(vim.cmd "windo set wrap"))))

(map [:v] :<leader><space> eval-expression {:desc "Evaluate expression"})

;; search with s instead of f
Expand Down Expand Up @@ -127,8 +133,13 @@

(map [:n] :<leader>h (bindcmd "tabmove -1") {:desc "Move tab to the left"})
(map [:n] :<leader>l (bindcmd "tabmove +1") {:desc "Move tab to the right"})

(map [:n] :<leader>s (bindcmd :split) {:desc "Split window horizontally"})
(map [:n] :<leader>v (bindcmd :vsplit) {:desc "Split window vertically"})
(map [:n] :sd (bindcmd "vertical resize -15") {:desc "Decrease split width"})
(map [:n] :si (bindcmd "vertical resize +15") {:desc "Increase split width"})
(map [:n] :<leader>w toggle-wrap {:desc "Toggle wrap"})

(map [:n] :<leader>q (bindcmd :qa) {:desc "Quit all"})
(map [:n] :<leader>Q (bindcmd :qa!) {:desc "Force quit all"})
(map [:n :v] :<leader>d64 "c<C-r>=system('base64 --decode', @\")<cr><Esc>"
Expand Down
3 changes: 3 additions & 0 deletions fnl/mods/ui/focus.fnl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(module mods.ui.focus {autoload {focus :focus }})

(focus.setup)
1 change: 1 addition & 0 deletions fnl/plugins.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
:folke/zen-mode.nvim {:mod :ui.zenmode}
:arkav/lualine-lsp-progress {:mod :ui.lualine}
:akinsho/bufferline.nvim {:requires [[:nvim-tree/nvim-web-devicons]] :mod :ui.tab}
:nvim-focus/focus.nvim {:mod :ui.focus}
;; programming
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :tools.treesitter}
:ray-x/go.nvim {:mod :dev.go_nvim}
Expand Down

0 comments on commit 3f99154

Please sign in to comment.