From 98f906b644a24dfb10b2eaa56ccc7c99c94c876f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 8 Aug 2022 13:51:12 +0200 Subject: Add session plugin --- fnl/config/alpha.fnl | 6 ++++-- fnl/config/auto-session.fnl | 20 ++++++++++++++++++++ fnl/config/init.fnl | 1 + fnl/config/telescope.fnl | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 fnl/config/auto-session.fnl (limited to 'fnl/config') 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 ") + [ (dashboard.button :e " New file" ":ene startinsert ") + (dashboard.button :f " Find file" ":Telescope find_files ") + (dashboard.button :t " Find text" ":Telescope live_grep ") + (dashboard.button :s " Find Session" ":SearchSession") (dashboard.button :p " Find project" ":Telescope projects ") (dashboard.button :r " Recently used files" ":Telescope oldfiles ") - (dashboard.button :t " Find text" ":Telescope live_grep ") (dashboard.button :c " Configuration" ":e ~/.config/nvim/init.lua ") (dashboard.button :q " Quit Neovim" ":qa")]) 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))) -- cgit v1.2.3-70-g09d2