summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl')
-rw-r--r--fnl/config/alpha.fnl1
-rw-r--r--fnl/config/auto-session.fnl17
-rw-r--r--fnl/config/cmd.fnl18
-rw-r--r--fnl/config/telescope.fnl8
-rw-r--r--fnl/config/which-key.fnl13
-rw-r--r--fnl/plugins.fnl10
6 files changed, 34 insertions, 33 deletions
diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl
index 2bb6041..e25e6ab 100644
--- a/fnl/config/alpha.fnl
+++ b/fnl/config/alpha.fnl
@@ -29,7 +29,6 @@
":Telescope find_files theme=dropdown<CR>")
(dashboard.button :t " Find text"
":Telescope live_grep theme=dropdown<CR>")
- (dashboard.button :s " Find Session" ":SearchSession<CR>")
(dashboard.button :p " Find project"
":Telescope projects theme=dropdown<CR>")
(dashboard.button :r " Recently used files"
diff --git a/fnl/config/auto-session.fnl b/fnl/config/auto-session.fnl
deleted file mode 100644
index 97834f7..0000000
--- a/fnl/config/auto-session.fnl
+++ /dev/null
@@ -1,17 +0,0 @@
-;; Session manager.
-(module config.auto-session {autoload {util config.util}})
-
-(def- auto-opts {:log_level :info
- :auto_session_enable_last_session false
- :auto_session_root_dir (.. (vim.fn.stdpath :data) :/sessions/)
- :auto_session_enabled true
- :auto_save_enabled nil
- :auto_restore_enabled nil
- :auto_session_suppress_dirs [(os.getenv :HOME)]
- :auto_session_use_git_branch nil
- :bypass_session_save_file_types [:alpha]})
-
-(set vim.o.sessionoptions
- "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal")
-
-(util.setup :auto-session auto-opts)
diff --git a/fnl/config/cmd.fnl b/fnl/config/cmd.fnl
index 1971260..e548839 100644
--- a/fnl/config/cmd.fnl
+++ b/fnl/config/cmd.fnl
@@ -66,3 +66,21 @@
(let [spectre (util.prequire :spectre)]
(spectre.open_file_search)))
{:nargs 0})
+
+(nvim.create_user_command :RestoreSession
+ (lambda []
+ (let [persistence (util.prequire :persistence)]
+ (persistence.load)))
+ {:nargs 0})
+
+(nvim.create_user_command :RestoreLastSession
+ (lambda []
+ (let [persistence (util.prequire :persistence)]
+ (persistence.load {:last true})))
+ {:nargs 0})
+
+(nvim.create_user_command :IgnoreSession
+ (lambda []
+ (let [persistence (util.prequire :persistence)]
+ (persistence.stop)))
+ {:nargs 0})
diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl
index a5fc4ab..ac3c33c 100644
--- a/fnl/config/telescope.fnl
+++ b/fnl/config/telescope.fnl
@@ -3,10 +3,6 @@
(def- opts {:noremap true :silent true})
-(def- lens-opts {:path_display [:shorten]
- :previewer false
- :prompt_title :Sessions})
-
(let [telescope (util.prequire :telescope)]
(let [actions (require :telescope.actions)]
(telescope.setup {:defaults {:prompt_prefix "  "
@@ -83,6 +79,4 @@
(telescope.load_extension :frecency)
(telescope.load_extension :orgmode)
(telescope.load_extension :projects)
- (telescope.load_extension :harpoon)
- (util.setup :session-lens lens-opts)
- (telescope.load_extension :session-lens)))
+ (telescope.load_extension :harpoon)))
diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 3944959..405fb1c 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -112,9 +112,14 @@
:s ["<cmd>Telescope lsp_document_symbols<cr>" "Document Symbols"]})
(def- replace {:name :replace
- :f [:<cmd>ReplaceInBuf<cr> "Replace in Buffer"]
- :r [:<cmd>Replace<cr> :Replace]
- :w [:<cmd>ReplaceWord<cr> "Replace Word"]})
+ :m [:<cmd>ReplaceInBuf<cr> "Replace in Buffer"]
+ :n [:<cmd>Replace<cr> :Replace]
+ :e [:<cmd>ReplaceWord<cr> "Replace Word"]})
+
+(def- session {:name :session
+ :m [:<cmd>RestoreSession<cr> "Restore session"]
+ :n [:<cmd>RestoreLastSession<cr> "Restore last session"]
+ :e [:<cmd>IgnoreSession<cr> "Ignore current session"]})
(def- treesitter
{:name :Treesitter :p [:<cmd>TSPlaygroundToggle<cr> :Playground]})
@@ -129,7 +134,9 @@
:h [:<cmd>ColorizerToggle<cr> :Colorizer]
:l lsp
:m [:<cmd>Mason<cr> :Mason]
+ :n [:<cmd>SymbolsOutline<cr> "Symbols outline"]
:r replace
+ :s session
:t [:<cmd>ToggleTerm<cr> :Terminal]
:u [:<cmd>UndotreeToggle<cr> :Undotree]
:y ["<cmd>Lazy home<cr>" :Home]
diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl
index 8b822b6..1300255 100644
--- a/fnl/plugins.fnl
+++ b/fnl/plugins.fnl
@@ -88,7 +88,6 @@
:tami5/sqlite.lua
:ahmedkhalf/project.nvim
:nvim-lua/plenary.nvim
- :rmagatti/session-lens
:nvim-telescope/telescope-fzf-native.nvim
:nvim-telescope/telescope-frecency.nvim
:joaomsa/telescope-orgmode.nvim]
@@ -96,7 +95,7 @@
(require :config.project)
(require :config.telescope))}
{1 :tamago324/lir.nvim
- :keys :-
+ :keys "-"
:config (fn []
(require :config.lir))
:dependencies [:kyazdani42/nvim-web-devicons]}
@@ -121,10 +120,10 @@
:config (fn []
(require :config.harpoon))}
;; Session plugins
- {1 :rmagatti/auto-session
- :lazy false
+ {1 :folke/persistence.nvim
+ :event :VeryLazy
:config (fn []
- (require :config.auto-session))}
+ (require :config.persistence))}
;; Text manipulation
{1 :numToStr/Comment.nvim
:event :VeryLazy
@@ -176,6 +175,7 @@
:event :VimEnter
:config (fn []
(require :config.alpha))}
+ {1 :simrat39/symbols-outline.nvim :cmd :SymbolsOutline :config true}
{1 :folke/which-key.nvim
:event :VeryLazy
:config (fn []