Halfway done
This commit is contained in:
parent
9419901702
commit
1cbcabc97b
125
fnl/plugin.fnl
125
fnl/plugin.fnl
@ -58,34 +58,45 @@
|
|||||||
:show_buffer_close_icons false
|
:show_buffer_close_icons false
|
||||||
:show_close_icon false }))
|
:show_close_icon false }))
|
||||||
|
|
||||||
;; fzf (a fuzzy finder)
|
;; telescope (a fuzzy finder)
|
||||||
(use! :ibhagwan/fzf-lua
|
(use! :nvim-telescope/telescope.nvim
|
||||||
:cmd :FzfLua
|
:requires [ :nvim-lua/plenary.nvim ]
|
||||||
:setup
|
:config
|
||||||
(bind! :n :<leader>fq "<cmd>FzfLua quickfix<cr>")
|
(let [builtin (require :telescope.builtin)
|
||||||
(bind! :n :<leader>fr "<cmd>FzfLua registers<cr>")
|
actions (require :telescope.actions)]
|
||||||
(bind! :n :<leader>fj "<cmd>FzfLua jumps<cr>")
|
(setup! :telescope
|
||||||
(bind! :n :<leader>fa "<cmd>FzfLua marks<cr>")
|
:defaults {
|
||||||
(bind! :n :<leader>fh "<cmd>FzfLua help_tags<cr>")
|
:mappings {
|
||||||
(bind! :n :<leader>g "<cmd>FzfLua live_grep<cr>")
|
:i { :<esc> actions.close
|
||||||
(bind! :n :<leader>fg "<cmd>FzfLua live_grep<cr>")
|
:<C-k> actions.move_selection_previous
|
||||||
(bind! :n :<leader>G "<cmd>FzfLua grep<cr>")
|
:<C-j> actions.move_selection_next }
|
||||||
(bind! :n :<leader>fG "<cmd>FzfLua grep<cr>")
|
:n { :<C-k> actions.move_selection_previous
|
||||||
(bind! :n :<leader>b "<cmd>FzfLua buffers<cr>")
|
:<C-j> actions.move_selection_next }}}
|
||||||
(bind! :n :gb "<cmd>FzfLua buffers<cr>")
|
:pickers {
|
||||||
(bind! :n :<leader>fu "<cmd>FzfLua git_status<cr>")
|
:buffers {
|
||||||
(bind! :n :<leader>fm "<cmd>FzfLua man_pages<cr>")
|
;;:ignore_current_buffer true
|
||||||
(bind! :n :<leader>fe "<cmd>FzfLua diagnostics_document<cr>")
|
:sort_lastused true }})
|
||||||
(bind! :n :<leader>fE "<cmd>FzfLua diagnostics_workspace<cr>")
|
(bind! :n :<leader>fq builtin.quickfix)
|
||||||
(bind! :n :<leader>d "<cmd>FzfLua loclist<cr>")
|
(bind! :n :<leader>fr builtin.registers)
|
||||||
(bind! :n :<leader>fp "<cmd>FzfLua spell_suggest<cr>")
|
(bind! :n :<leader>fj builtin.jumplist)
|
||||||
(bind! :n :<leader>i "<cmd>FzfLua files<cr>")
|
(bind! :n :<leader>fa builtin.marks)
|
||||||
(bind! :n :z= "<cmd>FzfLua spell_suggest<cr>")
|
(bind! :n :<leader>fh builtin.help_tags)
|
||||||
|
(bind! :n :<leader>g builtin.live_grep)
|
||||||
|
(bind! :n :<leader>fg builtin.live_grep)
|
||||||
|
(bind! :n :<leader>b builtin.buffers)
|
||||||
|
(bind! :n :gb builtin.buffers)
|
||||||
|
(bind! :n :<leader>fu builtin.git_status)
|
||||||
|
(bind! :n :<leader>fm builtin.man_pages)
|
||||||
|
(bind! :n :<leader>fe builtin.diagnostics)
|
||||||
|
(bind! :n :<leader>d builtin.loclist)
|
||||||
|
(bind! :n :<leader>fp builtin.spell_suggest)
|
||||||
|
(bind! :n :<leader>i builtin.find_files)
|
||||||
|
(bind! :n :z= builtin.spell_suggest)
|
||||||
(fn list-git-or-default []
|
(fn list-git-or-default []
|
||||||
(let [code (os.execute "git rev-parse --is-inside-work-tree >/dev/null 2>&1")]
|
(let [code (os.execute "git rev-parse --is-inside-work-tree >/dev/null 2>&1")]
|
||||||
(if (= code 0)
|
(if (= code 0)
|
||||||
(vim.cmd "FzfLua git_files")
|
(builtin.git_files)
|
||||||
(vim.cmd "FzfLua files"))))
|
(builtin.find_files))))
|
||||||
(bind! :n :<leader>ff list-git-or-default)
|
(bind! :n :<leader>ff list-git-or-default)
|
||||||
(bind! :n :<leader>u list-git-or-default)
|
(bind! :n :<leader>u list-git-or-default)
|
||||||
(fn jump-or-open-terminal []
|
(fn jump-or-open-terminal []
|
||||||
@ -103,11 +114,65 @@
|
|||||||
(vim.cmd.terminal)
|
(vim.cmd.terminal)
|
||||||
(= term_count 1)
|
(= term_count 1)
|
||||||
(vim.cmd.buffer last_id)
|
(vim.cmd.buffer last_id)
|
||||||
(vim.cmd "FzfLua buffers query=term://")))
|
(builtin.buffers { :default_text "term://" })))
|
||||||
(bind! :n :<leader>t jump-or-open-terminal)
|
(bind! :n :<leader>t jump-or-open-terminal)))
|
||||||
|
|
||||||
|
;; dressing.nvim nicer vim.ui stuff
|
||||||
|
(use! :stevearc/dressing.nvim
|
||||||
|
:after :telescope.nvim
|
||||||
:config
|
:config
|
||||||
(let [fzf (require :fzf-lua)]
|
(setup! :dressing))
|
||||||
(fzf.register_ui_select)))
|
|
||||||
|
;; fzf (a fuzzy finder)
|
||||||
|
;(use! :ibhagwan/fzf-lua
|
||||||
|
; :cmd :FzfLua
|
||||||
|
; :setup
|
||||||
|
; (bind! :n :<leader>fq "<cmd>FzfLua quickfix<cr>")
|
||||||
|
; (bind! :n :<leader>fr "<cmd>FzfLua registers<cr>")
|
||||||
|
; (bind! :n :<leader>fj "<cmd>FzfLua jumps<cr>")
|
||||||
|
; (bind! :n :<leader>fa "<cmd>FzfLua marks<cr>")
|
||||||
|
; (bind! :n :<leader>fh "<cmd>FzfLua help_tags<cr>")
|
||||||
|
; (bind! :n :<leader>g "<cmd>FzfLua live_grep<cr>")
|
||||||
|
; (bind! :n :<leader>fg "<cmd>FzfLua live_grep<cr>")
|
||||||
|
; (bind! :n :<leader>G "<cmd>FzfLua grep<cr>")
|
||||||
|
; (bind! :n :<leader>fG "<cmd>FzfLua grep<cr>")
|
||||||
|
; (bind! :n :<leader>b "<cmd>FzfLua buffers<cr>")
|
||||||
|
; (bind! :n :gb "<cmd>FzfLua buffers<cr>")
|
||||||
|
; (bind! :n :<leader>fu "<cmd>FzfLua git_status<cr>")
|
||||||
|
; (bind! :n :<leader>fm "<cmd>FzfLua man_pages<cr>")
|
||||||
|
; (bind! :n :<leader>fe "<cmd>FzfLua diagnostics_document<cr>")
|
||||||
|
; (bind! :n :<leader>fE "<cmd>FzfLua diagnostics_workspace<cr>")
|
||||||
|
; (bind! :n :<leader>d "<cmd>FzfLua loclist<cr>")
|
||||||
|
; (bind! :n :<leader>fp "<cmd>FzfLua spell_suggest<cr>")
|
||||||
|
; (bind! :n :<leader>i "<cmd>FzfLua files<cr>")
|
||||||
|
; (bind! :n :z= "<cmd>FzfLua spell_suggest<cr>")
|
||||||
|
; (fn list-git-or-default []
|
||||||
|
; (let [code (os.execute "git rev-parse --is-inside-work-tree >/dev/null 2>&1")]
|
||||||
|
; (if (= code 0)
|
||||||
|
; (vim.cmd "FzfLua git_files")
|
||||||
|
; (vim.cmd "FzfLua files"))))
|
||||||
|
; (bind! :n :<leader>ff list-git-or-default)
|
||||||
|
; (bind! :n :<leader>u list-git-or-default)
|
||||||
|
; (fn jump-or-open-terminal []
|
||||||
|
; "If no terminal buffer exists, create one. Otherwise, open new one."
|
||||||
|
; (var term_count 0)
|
||||||
|
; (var last_id 0)
|
||||||
|
; (var terms [ ])
|
||||||
|
; (each [_ id (pairs (vim.api.nvim_list_bufs))]
|
||||||
|
; (let [name (vim.api.nvim_buf_get_name id)]
|
||||||
|
; (when (vim.startswith name "term://")
|
||||||
|
; (table.insert terms name)
|
||||||
|
; (set term_count (+ term_count 1))
|
||||||
|
; (set last_id id))))
|
||||||
|
; (if (= term_count 0)
|
||||||
|
; (vim.cmd.terminal)
|
||||||
|
; (= term_count 1)
|
||||||
|
; (vim.cmd.buffer last_id)
|
||||||
|
; (vim.cmd "FzfLua buffers query=term://")))
|
||||||
|
; (bind! :n :<leader>t jump-or-open-terminal)
|
||||||
|
; :config
|
||||||
|
; (let [fzf (require :fzf-lua)]
|
||||||
|
; (fzf.register_ui_select)))
|
||||||
|
|
||||||
;; Nvim surround
|
;; Nvim surround
|
||||||
(use! :kylechui/nvim-surround
|
(use! :kylechui/nvim-surround
|
||||||
@ -212,7 +277,7 @@
|
|||||||
(bind! :n :<leader>ci "<cmd>IconPickerNormal<cr>")
|
(bind! :n :<leader>ci "<cmd>IconPickerNormal<cr>")
|
||||||
(bind! :n :<leader>cy "<cmd>IconPickerYank<cr>")
|
(bind! :n :<leader>cy "<cmd>IconPickerYank<cr>")
|
||||||
:config
|
:config
|
||||||
(vim.cmd "PackerLoad fzf-lua")
|
;;(vim.cmd "PackerLoad fzf-lua")
|
||||||
(setup! :icon-picker
|
(setup! :icon-picker
|
||||||
:disable_legacy_commands true))
|
:disable_legacy_commands true))
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
{ :name "buffer" :priority 0 :group 3 }
|
{ :name "buffer" :priority 0 :group 3 }
|
||||||
{ :name "path" :priority 0 :group 4 }]})
|
{ :name "path" :priority 0 :group 4 }]})
|
||||||
(bind! :n :gD vim.lsp.buf.declaration buf)
|
(bind! :n :gD vim.lsp.buf.declaration buf)
|
||||||
(bind! :n :gd vim.lsp.buf.definition buf)
|
;; (bind! :n :gd vim.lsp.buf.definition buf)
|
||||||
(bind! :n :K vim.lsp.buf.hover buf)
|
(bind! :n :K vim.lsp.buf.hover buf)
|
||||||
(bind! :n :gI vim.lsp.buf.implementation buf)
|
;; (bind! :n :gI vim.lsp.buf.implementation buf)
|
||||||
(bind! :n :<C-k> vim.lsp.buf.signature_help buf)
|
(bind! :n :<C-k> vim.lsp.buf.signature_help buf)
|
||||||
(bind! :n :<leader>wa vim.lsp.buf.add_workspace_folder buf)
|
(bind! :n :<leader>wa vim.lsp.buf.add_workspace_folder buf)
|
||||||
(bind! :n :<leader>wr vim.lsp.buf.remove_workspace_folder buf)
|
(bind! :n :<leader>wr vim.lsp.buf.remove_workspace_folder buf)
|
||||||
@ -19,18 +19,31 @@
|
|||||||
(vim.lsp.buf.list_workspace_folders))) buf)
|
(vim.lsp.buf.list_workspace_folders))) buf)
|
||||||
(bind! :n :<leader>D vim.lsp.buf.type_definition buf)
|
(bind! :n :<leader>D vim.lsp.buf.type_definition buf)
|
||||||
(bind! :n :<leader>rn vim.lsp.buf.rename buf)
|
(bind! :n :<leader>rn vim.lsp.buf.rename buf)
|
||||||
; (bind! :n :<leader>cn vim.lsp.buf.code_action buf)
|
(bind! :n :<leader>cn vim.lsp.buf.code_action buf)
|
||||||
; (bind! :n :gr vim.lsp.buf.references buf)
|
; (bind! :n :gr vim.lsp.buf.references buf)
|
||||||
; (bind! :n :<leader>o #(vim.lsp.buf.format { :async true }) buf)
|
; (bind! :n :<leader>o #(vim.lsp.buf.format { :async true }) buf)
|
||||||
|
|
||||||
;; Some fzf commands
|
;; Some fzf commands
|
||||||
(bind! :n :gr "<cmd>FzfLua lsp_references<cr>" buf)
|
;(bind! :n :gr "<cmd>FzfLua lsp_references<cr>" buf)
|
||||||
(bind! :n :<leader>s "<cmd>FzfLua lsp_live_workspace_symbols<cr>" buf)
|
;(bind! :n :<leader>s "<cmd>FzfLua lsp_live_workspace_symbols<cr>" buf)
|
||||||
(bind! :n :<leader>fs "<cmd>FzfLua lsp_live_workspace_symbols<cr>" buf)
|
;(bind! :n :<leader>fs "<cmd>FzfLua lsp_live_workspace_symbols<cr>" buf)
|
||||||
(bind! :n :<leader>fS "<cmd>FzfLua lsp_workspace_symbols<cr>" buf)
|
;(bind! :n :<leader>fS "<cmd>FzfLua lsp_workspace_symbols<cr>" buf)
|
||||||
(bind! :n :<leader>d "<cmd>FzfLua lsp_document_symbols<cr>" buf)
|
;(bind! :n :<leader>d "<cmd>FzfLua lsp_document_symbols<cr>" buf)
|
||||||
(bind! :n :<leader>fd "<cmd>FzfLua lsp_document_symbols<cr>" buf)
|
;(bind! :n :<leader>fd "<cmd>FzfLua lsp_document_symbols<cr>" buf)
|
||||||
(bind! :n :<leader>cn "<cmd>FzfLua lsp_code_actions<cr>" buf))
|
;(bind! :n :<leader>cn "<cmd>FzfLua lsp_code_actions<cr>" buf)
|
||||||
|
|
||||||
|
;; Some telescope commands
|
||||||
|
(let [builtin (require :telescope.builtin)]
|
||||||
|
(bind! :n :gr builtin.lsp_references buf)
|
||||||
|
(bind! :n :<leader>s builtin.lsp_live_workspace_symbols buf)
|
||||||
|
(bind! :n :<leader>fs builtin.lsp_live_workspace_symbols buf)
|
||||||
|
(bind! :n :<leader>fS builtin.lsp_workspace_symbols buf)
|
||||||
|
(bind! :n :<leader>d builtin.lsp_document_symbols buf)
|
||||||
|
(bind! :n :<leader>fd builtin.lsp_document_symbols buf)
|
||||||
|
(bind! :n :<leader>cn builtin.lsp_code_actions buf)
|
||||||
|
(bind! :n :gd vim.lsp.buf.definition buf)
|
||||||
|
(bind! :n :gI vim.lsp.buf.implementation buf)))
|
||||||
|
|
||||||
|
|
||||||
(fn get-data-dir [server root]
|
(fn get-data-dir [server root]
|
||||||
(let [resolved_path (vim.fn.resolve root)
|
(let [resolved_path (vim.fn.resolve root)
|
||||||
|
Reference in New Issue
Block a user