summaryrefslogtreecommitdiff
path: root/fnl/config
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-08 13:51:12 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-08 13:51:12 +0200
commit98f906b644a24dfb10b2eaa56ccc7c99c94c876f (patch)
tree99046bf5fd111dbdfbe6b4a793c57fa354af2927 /fnl/config
parent9dd308b444ede3a68a29961e956937d2ce402e45 (diff)
Add session plugin
Diffstat (limited to 'fnl/config')
-rw-r--r--fnl/config/alpha.fnl6
-rw-r--r--fnl/config/auto-session.fnl20
-rw-r--r--fnl/config/init.fnl1
-rw-r--r--fnl/config/telescope.fnl1
4 files changed, 26 insertions, 2 deletions
diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl
index fcbbb8c..0f0f680 100644
--- a/fnl/config/alpha.fnl
+++ b/fnl/config/alpha.fnl
@@ -24,12 +24,14 @@
(let [dashboard (require :alpha.themes.dashboard)]
(set dashboard.section.header.val ascii-art)
(set dashboard.section.buttons.val
- [(dashboard.button :f " Find file" ":Telescope find_files <CR>")
+ [
(dashboard.button :e " New file" ":ene <BAR> startinsert <CR>")
+ (dashboard.button :f " Find file" ":Telescope find_files <CR>")
+ (dashboard.button :t " Find text" ":Telescope live_grep <CR>")
+ (dashboard.button :s " Find Session" ":SearchSession<CR>")
(dashboard.button :p " Find project" ":Telescope projects <CR>")
(dashboard.button :r " Recently used files"
":Telescope oldfiles <CR>")
- (dashboard.button :t " Find text" ":Telescope live_grep <CR>")
(dashboard.button :c " Configuration"
":e ~/.config/nvim/init.lua <CR>")
(dashboard.button :q " Quit Neovim" ":qa<CR>")])
diff --git a/fnl/config/auto-session.fnl b/fnl/config/auto-session.fnl
new file mode 100644
index 0000000..62e28b4
--- /dev/null
+++ b/fnl/config/auto-session.fnl
@@ -0,0 +1,20 @@
+;; Session manager.
+(module config.auto-session {autoload {: 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]})
+
+(def- lens-opts {:path_display [:shorten]
+ :previewer false
+ :prompt_title :Sessions})
+
+(set vim.o.sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal")
+(util.use-config :session-lens lens-opts)
+(util.use-config :auto-session auto-opts)
diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl
index 1f7c174..ade6d91 100644
--- a/fnl/config/init.fnl
+++ b/fnl/config/init.fnl
@@ -1,6 +1,7 @@
;; Load all plugin configs.
(module config.init {require [config.aerial
config.alpha
+ ;;config.auto-session
config.autocmd
config.autopairs
config.better-escape
diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl
index 9d11106..a53433d 100644
--- a/fnl/config/telescope.fnl
+++ b/fnl/config/telescope.fnl
@@ -77,4 +77,5 @@
:case_mode :smart_case}}})
(telescope.load_extension :fzf)
(telescope.load_extension :file_browser)
+ (telescope.load_extension :session-lens)
(telescope.load_extension :projects)))