fnlfmt:
This commit is contained in:
parent
a34700b8bf
commit
5613801fa3
85
fnl/init.fnl
85
fnl/init.fnl
|
@ -1,52 +1,41 @@
|
||||||
;; Package Management via lazy.nvim
|
;; Package Management via lazy.nvim
|
||||||
(let
|
(let [lazy (require :lazy)
|
||||||
[lazy (require :lazy)
|
lazypath (.. (vim.fn.stdpath :data) :/lazy/lazy.nvim)]
|
||||||
lazypath (.. (vim.fn.stdpath "data") "/lazy/lazy.nvim")
|
(if (not (vim.loop.fs_stat lazypath))
|
||||||
]
|
(vim.fn.system [:git
|
||||||
(if (not (vim.loop.fs_stat lazypath))
|
:clone
|
||||||
(vim.fn.system
|
"--filter=blob:none"
|
||||||
["git"
|
"https://github.com/folke/lazy.nvim.git"
|
||||||
"clone"
|
:--branch=stable
|
||||||
"--filter=blob:none"
|
lazypath]))
|
||||||
"https://github.com/folke/lazy.nvim.git"
|
(vim.opt.rtp:prepend lazypath)
|
||||||
"--branch=stable"
|
(lazy.setup ["https://github.com/rktjmp/hotpot.nvim"
|
||||||
lazypath]))
|
{:url "https://github.com/nvim-telescope/telescope.nvim"
|
||||||
(vim.opt.rtp:prepend lazypath)
|
:tag :0.1.2
|
||||||
(lazy.setup
|
:dependencies [:nvim-lua/plenary.nvim]}
|
||||||
["https://github.com/rktjmp/hotpot.nvim"
|
{:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||||
{:url "https://github.com/nvim-telescope/telescope.nvim"
|
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
||||||
:tag "0.1.2"
|
" && cmake --build build --config Release"
|
||||||
:dependencies ["nvim-lua/plenary.nvim"]}
|
" && cmake --install build --prefix build")}
|
||||||
{:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
{:url "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
:build ":TSUpdate"}
|
||||||
" && cmake --build build --config Release"
|
{:url "https://github.com/neovim/nvim-lspconfig"
|
||||||
" && cmake --install build --prefix build" )}
|
:dependencies ["https://github.com/williamboman/mason.nvim"
|
||||||
{:url "https://github.com/nvim-treesitter/nvim-treesitter"
|
:williamboman/mason-lspconfig.nvim
|
||||||
:build ":TSUpdate"}
|
{:url "https://github.com/j-hui/fidget.nvim"
|
||||||
{:url "https://github.com/neovim/nvim-lspconfig"
|
:tag :legacy
|
||||||
:dependencies
|
:opts {}}
|
||||||
["https://github.com/williamboman/mason.nvim"
|
:folke/neodev.nvim]}
|
||||||
"williamboman/mason-lspconfig.nvim"
|
{:url "https://github.com/hrsh7th/nvim-cmp"
|
||||||
{:url "https://github.com/j-hui/fidget.nvim"
|
:dependencies ["https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||||
:tag "legacy"
|
"https://github.com/hrsh7th/cmp-buffer"
|
||||||
:opts {}}
|
"https://github.com/hrsh7th/cmp-path"
|
||||||
"folke/neodev.nvim"
|
"https://github.com/hrsh7th/cmp-cmdline"
|
||||||
]}
|
"https://github.com/hrsh7th/cmp-cmdline"]}
|
||||||
{:url "https://github.com/hrsh7th/nvim-cmp"
|
{:url "https://github.com/L3MON4D3/LuaSnip"
|
||||||
:dependencies
|
:dependencies ["https://github.com/saadparwaiz1/cmp_luasnip"
|
||||||
["https://github.com/hrsh7th/cmp-nvim-lsp"
|
"https://github.com/rafamadriz/friendly-snippets"]}
|
||||||
"https://github.com/hrsh7th/cmp-buffer"
|
"https://github.com/sainnhe/everforest"]))
|
||||||
"https://github.com/hrsh7th/cmp-path"
|
|
||||||
"https://github.com/hrsh7th/cmp-cmdline"
|
|
||||||
"https://github.com/hrsh7th/cmp-cmdline"
|
|
||||||
]}
|
|
||||||
{:url "https://github.com/L3MON4D3/LuaSnip"
|
|
||||||
:dependencies
|
|
||||||
[{:url "https://github.com/saadparwaiz1/cmp_luasnip"}
|
|
||||||
{:url "https://github.com/rafamadriz/friendly-snippets"}
|
|
||||||
]}
|
|
||||||
"https://github.com/sainnhe/everforest"
|
|
||||||
]))
|
|
||||||
|
|
||||||
(let [telescope (require :telescope)]
|
(let [telescope (require :telescope)]
|
||||||
(pcall (telescope.load_extension :fzf)))
|
(pcall (telescope.load_extension :fzf)))
|
||||||
|
|
|
@ -1,69 +1,62 @@
|
||||||
(let
|
(let [cmp (require :cmp)
|
||||||
[cmp (require :cmp)
|
luasnip (require :luasnip)]
|
||||||
luasnip (require :luasnip)
|
{:options (fn []
|
||||||
]
|
(set vim.o.termguicolors true)
|
||||||
{:options (fn []
|
(set vim.o.mouse :a)
|
||||||
(set vim.o.termguicolors true)
|
(set vim.o.clipboard :unnamedplus)
|
||||||
(set vim.o.mouse :a)
|
(set vim.o.wrap false)
|
||||||
(set vim.o.clipboard :unnamedplus)
|
(set vim.opt.colorcolumn "80,120")
|
||||||
(set vim.o.wrap false)
|
(vim.cmd.colorscheme :everforest))
|
||||||
(set vim.opt.colorcolumn "80,120")
|
:keymap (fn []
|
||||||
(vim.cmd.colorscheme :everforest))
|
(let [nmap #(vim.keymap.set [:n] $1 $2 {:desc $3})]
|
||||||
|
(nmap :<Tab> ":bnext<CR>" "Next Buffer")
|
||||||
:keymap (fn []
|
(nmap :<S-Tab> ":bprevious<CR>" "Previous Buffer")
|
||||||
(let [nmap #(vim.keymap.set [:n] $1 $2 {:desc $3})]
|
(nmap :<C-X> ":write|bdelete<CR>" "Save and delete buffer")
|
||||||
(nmap "<Tab>" ":bnext<CR>" "Next Buffer")
|
(nmap :<C-P> ":Telescope find_files<CR>" "Telescope find_files")
|
||||||
(nmap "<S-Tab>" ":bprevious<CR>" "Previous Buffer")
|
(nmap :<C-F> ":Telescope live_grep<CR>" "Telescope live_grep")
|
||||||
(nmap "<C-X>" ":write|bdelete<CR>" "Save and delete buffer")
|
(nmap :<C-B> ":Telescope buffers<CR>" "Telescope buffers")
|
||||||
(nmap "<C-P>" ":Telescope find_files<CR>" "Telescope find_files")
|
(nmap :<C-T> ":Telescope treesitter<CR>" "Telescope treesitter")))
|
||||||
(nmap "<C-F>" ":Telescope live_grep<CR>" "Telescope live_grep")
|
:treesitter-languages [:c
|
||||||
(nmap "<C-B>" ":Telescope buffers<CR>" "Telescope buffers")
|
:lua
|
||||||
(nmap "<C-T>" ":Telescope treesitter<CR>" "Telescope treesitter")))
|
:vim
|
||||||
|
:vimdoc
|
||||||
:treesitter-languages
|
:query
|
||||||
[:c :lua :vim :vimdoc :query ; required
|
:fennel]
|
||||||
:fennel] ; add new languages here
|
:language-servers {:lua_ls {:filetypes [:lua]
|
||||||
|
:Lua {:workspace {:checkThirdParty false}}
|
||||||
:language-servers
|
:telemetry {:enable false}
|
||||||
{:lua_ls {:filetypes [:lua]
|
:diagnostics {:globals [:vim]}}
|
||||||
:Lua
|
:fennel_language_server {:filetypes [:fennel]
|
||||||
{:workspace {:checkThirdParty false}}
|
:fennel {:workspace {:library (vim.api.nvim_list_runtime_paths)}
|
||||||
:telemetry {:enable false}
|
:diagnostics {:globals [:vim]}}}
|
||||||
:diagnostics {:globals
|
:bashls {:filetypes [:bash]}}
|
||||||
[:vim
|
:lsp-attach (fn [_ bufnr]
|
||||||
]}}
|
(let [nmap #(vim.keymap.set :n $1 $2
|
||||||
:fennel_language_server {:filetypes [:fennel]
|
{:buffer bufnr
|
||||||
:fennel
|
:desc (.. "LSP: " $3)})
|
||||||
{:workspace {:library (vim.api.nvim_list_runtime_paths)}
|
telescope (require :telescope.builtin)]
|
||||||
:diagnostics {:globals
|
(nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton")
|
||||||
[:vim
|
(nmap :gr telescope.lsp_references "[G]o to [R]eferences")
|
||||||
]}}}
|
(nmap :gI vim.lsp.buf.implementation
|
||||||
:bashls {:filetypes [:bash]}}
|
"[G]o to [I]mplementation")
|
||||||
|
(vim.api.nvim_buf_create_user_command bufnr :Format
|
||||||
:lsp-attach (fn [_ bufnr]
|
#(vim.lsp.buf.format)
|
||||||
(let
|
"Format current buffer with LSP")))
|
||||||
[nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)})
|
:cmp-mapping {:<C-j> (cmp.mapping.select_next_item)
|
||||||
telescope (require :telescope.builtin)
|
:<C-k> (cmp.mapping.select_prev_item)
|
||||||
]
|
:<C-d> (cmp.mapping.scroll_docs -4)
|
||||||
(nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton")
|
:<C-f> (cmp.mapping.scroll_docs 4)
|
||||||
(nmap :gr telescope.lsp_references "[G]o to [R]eferences")
|
:<C-Space> (cmp.mapping.complete)
|
||||||
(nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation")
|
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace
|
||||||
(vim.api.nvim_buf_create_user_command bufnr "Format"
|
:select true})
|
||||||
#(vim.lsp.buf.format)
|
:<Tab> (cmp.mapping (fn [fallback]
|
||||||
"Format current buffer with LSP")))
|
(if (cmp.visible) (cmp.select_prev_item)
|
||||||
|
(luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump)
|
||||||
:cmp-mapping
|
(fallback)))
|
||||||
{:<C-j> (cmp.mapping.select_next_item)
|
[:i :s])
|
||||||
:<C-k> (cmp.mapping.select_prev_item)
|
:<S-Tab> (cmp.mapping (fn [fallback]
|
||||||
:<C-d> (cmp.mapping.scroll_docs -4)
|
(if (cmp.visible)
|
||||||
:<C-f> (cmp.mapping.scroll_docs 4)
|
(cmp.select_prev_item)
|
||||||
:<C-Space> (cmp.mapping.complete)
|
(luasnip.locally_jumpable -1)
|
||||||
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true})
|
(luasnip.jump -1) (fallback)))
|
||||||
:<Tab> (cmp.mapping (fn [fallback]
|
[:i :s])}})
|
||||||
(if (cmp.visible) (cmp.select_prev_item)
|
|
||||||
(luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump)
|
|
||||||
(fallback))) [:i :s])
|
|
||||||
:<S-Tab> (cmp.mapping (fn [fallback]
|
|
||||||
(if (cmp.visible) (cmp.select_prev_item)
|
|
||||||
(luasnip.locally_jumpable -1) (luasnip.jump -1)
|
|
||||||
(fallback))) [:i :s])}})
|
|
||||||
|
|
|
@ -1,32 +1,22 @@
|
||||||
(let
|
(let [cmp (require :cmp)
|
||||||
[cmp (require :cmp)
|
luasnip (require :luasnip)
|
||||||
luasnip (require :luasnip)
|
vscode-snips (require :luasnip.loaders.from_vscode)
|
||||||
vscode-snips (require :luasnip.loaders.from_vscode)
|
{: cmp-mapping} (require :personalize)]
|
||||||
{: cmp-mapping} (require :personalize)
|
(vscode-snips.lazy_load)
|
||||||
]
|
(luasnip.config.setup)
|
||||||
(vscode-snips.lazy_load)
|
(cmp.setup {:snippet {:expand #(luasnip $1)}
|
||||||
(luasnip.config.setup)
|
:mapping (cmp.mapping.preset.insert cmp-mapping)
|
||||||
(cmp.setup
|
:sources (cmp.config.sources [{:name :nvim_lsp}
|
||||||
{:snippet {:expand #(luasnip $1)}
|
{:name :luasnip}
|
||||||
:mapping (cmp.mapping.preset.insert cmp-mapping)
|
{:name :buffer}])})
|
||||||
:sources (cmp.config.sources
|
(cmp.setup.cmdline ["/" "?"]
|
||||||
[{:name :nvim_lsp}
|
{:mapping (cmp.mapping.preset.cmdline)
|
||||||
{:name :luasnip}
|
:sources [{:name :buffer}]})
|
||||||
{:name :buffer}
|
(cmp.setup.cmdline [":"]
|
||||||
])})
|
{:mapping (cmp.mapping.preset.cmdline)
|
||||||
(cmp.setup.cmdline ["/" "?"]
|
:sources (cmp.config.sources [{:name :path}
|
||||||
{:mapping (cmp.mapping.preset.cmdline)
|
{:name :cmdline}])})
|
||||||
:sources
|
(cmp.setup.filetype [:gitcommit]
|
||||||
[{:name :buffer}]
|
{:mapping (cmp.mapping.preset.cmdline)
|
||||||
})
|
:sources (cmp.config.sources [{:name :git}
|
||||||
(cmp.setup.cmdline [":"]
|
{:name :buffer}])}))
|
||||||
{:mapping (cmp.mapping.preset.cmdline)
|
|
||||||
:sources (cmp.config.sources
|
|
||||||
[{:name :path}
|
|
||||||
{:name :cmdline}])})
|
|
||||||
(cmp.setup.filetype [:gitcommit]
|
|
||||||
{:mapping (cmp.mapping.preset.cmdline)
|
|
||||||
:sources (cmp.config.sources
|
|
||||||
[{:name :git}
|
|
||||||
{:name :buffer}])
|
|
||||||
}))
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
(let
|
(let [neodev (require :neodev)
|
||||||
[neodev (require :neodev)
|
mason (require :mason)
|
||||||
mason (require :mason)
|
mason-lspconfig (require :mason-lspconfig)
|
||||||
mason-lspconfig (require :mason-lspconfig)
|
{: language-servers : lsp-attach} (require :personalize)]
|
||||||
{: language-servers : lsp-attach} (require :personalize)
|
(neodev.setup)
|
||||||
]
|
(mason.setup)
|
||||||
(neodev.setup)
|
(mason-lspconfig.setup {:ensure_installed (vim.tbl_keys language-servers)})
|
||||||
(mason.setup)
|
(mason-lspconfig.setup_handlers
|
||||||
(mason-lspconfig.setup {:ensure_installed (vim.tbl_keys language-servers)})
|
[(fn [server_name]
|
||||||
(mason-lspconfig.setup_handlers
|
(let [server (. (require :lspconfig)
|
||||||
[(fn [server_name] (let
|
server_name)
|
||||||
[server (. (require :lspconfig) server_name)
|
cmp-nvim-lsp (require :cmp_nvim_lsp)
|
||||||
cmp-nvim-lsp (require :cmp_nvim_lsp)
|
settings (. language-servers
|
||||||
settings (. language-servers server_name)
|
server_name)]
|
||||||
]
|
(server.setup {:capabilities (cmp-nvim-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities))
|
||||||
(server.setup
|
:on_attach lsp-attach
|
||||||
{:capabilities (cmp-nvim-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities))
|
: settings
|
||||||
:on_attach lsp-attach
|
:filetypes (or settings.filetypes
|
||||||
:settings settings
|
[])})))]))
|
||||||
:filetypes (or settings.filetypes [])})))
|
|
||||||
]))
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
(let
|
(let [treesitter (require :nvim-treesitter.configs)
|
||||||
[treesitter (require :nvim-treesitter.configs)
|
{: treesitter-languages} (require :personalize)]
|
||||||
{: treesitter-languages} (require :personalize)
|
(treesitter.setup {:ensure_installed treesitter-languages
|
||||||
]
|
:sync_install false
|
||||||
(treesitter.setup
|
:auto_install true
|
||||||
{:ensure_installed treesitter-languages
|
:highlight {:enable true}
|
||||||
:sync_install false
|
:indent {:enable true}}))
|
||||||
:auto_install false
|
|
||||||
:ignore_install [] ; could :ensure_installed :all, then ignore unwanted.
|
|
||||||
:highlight {:enable true}
|
|
||||||
:indent {:enable true}}))
|
|
||||||
|
|
Loading…
Reference in a new issue