diff --git a/.editorconfig b/.editorconfig index 740aa28..3e56d86 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,13 @@ +[*] +# optional space/tab +indent_style = space +# if indent_style is space, this is valid +indent_size = 2 +# if indent_style is tab, this is valid +tab_width = 2 +# none/single/double +quote_style = double + [*.lua] # [basic] diff --git a/fnl/lazy-setup.fnl b/fnl/lazy-setup.fnl index 0792784..478fd8e 100644 --- a/fnl/lazy-setup.fnl +++ b/fnl/lazy-setup.fnl @@ -13,64 +13,59 @@ (lazy.setup ["https://github.com/rktjmp/hotpot.nvim" {:url "https://github.com/nvim-telescope/telescope.nvim" - :tag "0.1.2" - :dependencies ["nvim-lua/plenary.nvim"]} + :tag "0.1.2" + :dependencies ["nvim-lua/plenary.nvim"]} {:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim" - :build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release" - " && cmake --build build --config Release" - " && cmake --install build --prefix build" )} - ;; TODO LSP configurations... - ;; {:url "https://github.com/neovim/nvim-lspconfig" - ;; :dependencies - ;; ["https://github.com/williamboman/mason.nvim" - ;; "williamboman/mason-lspconfig.nvim" - ;; {:url "https://github.com/j-hui/fidget.nvim" - ;; :tag "legacy" - ;; :opts {}} ; NOTE: `opts = {}` is the same as calling `require("fidget").setup({})` - ;; "folke/neodev.nvim"]} + :build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release" + " && cmake --build build --config Release" + " && cmake --install build --prefix build" )} + {:url "https://github.com/neovim/nvim-lspconfig" + :dependencies + ["https://github.com/williamboman/mason.nvim" + "williamboman/mason-lspconfig.nvim" + {:url "https://github.com/j-hui/fidget.nvim" + :tag "legacy" + :opts {}} ; NOTE: `opts = {}` is the same as calling `require("fidget").setup({})` + "folke/neodev.nvim"]} ])) (let [telescope (require "telescope")] (pcall (telescope.load_extension :fzf))) -;; TODO fix LSP stuff... -;; (let [neodev (require :neodev)] -;; (neodev.setup)) - -;; TODO mason can't find the modules it installs... -;; (let -;; [mason (require :mason) -;; mason-lspconfig (require :mason-lspconfig) -;; servers -;; {:lua_ls { -;; :Lua { -;; :workspace { :checkThirdParty false } -;; :telemetry { :enable false }}} -;; :fennel_language_server {} -;; :bash_language_server {} -;; :jq {} -;; } -;; on_attach (fn [_ bufnr] -;; (let -;; [nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)}) -;; telescope (require :telescope.builtin) -;; ] -;; (nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton") -;; (nmap :gr telescope.lsp_references "[G]o to [R]eferences") -;; (nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation") -;; (vim.api.nvim_buf_create_user_command bufnr "Format" #(vim.lsp.buf.format) -;; "Format current buffer with LSP"))) -;; ] -;; (mason.setup) -;; (mason-lspconfig.setup) -;; (mason-lspconfig.setup_handlers -;; [(fn [server_name] (let -;; [server (require server_name) -;; settings (. servers server_name) -;; filetypes (or settings.filetypes []) -;; ] -;; (server.setup {:capabilities (vim.lsp.protocol.make_client_capabilities) -;; :on_attach on_attach -;; :settings settings -;; :filetypes filetypes}))) -;; ])) +(let + [neodev (require :neodev) + mason (require :mason) + mason-lspconfig (require :mason-lspconfig) + servers + {:lua_ls { + :Lua { + :workspace { :checkThirdParty false } + :telemetry { :enable false }}} + ;:fennel_language_server {} + ;:bash_language_server {} + ;:jq {} + } + on_attach (fn [_ bufnr] + (let + [nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)}) + telescope (require :telescope.builtin) + ] + (nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton") + (nmap :gr telescope.lsp_references "[G]o to [R]eferences") + (nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation") + (vim.api.nvim_buf_create_user_command bufnr "Format" #(vim.lsp.buf.format) + "Format current buffer with LSP"))) + ] + (neodev.setup) + (mason.setup) + (mason-lspconfig.setup) + (mason-lspconfig.setup_handlers + [(fn [server_name] (let + [server (require server_name) + ] + (server.setup + {:capabilities (vim.lsp.protocol.make_client_capabilities) + :on_attach on_attach + :settings (. servers server_name) + :filetypes (or settings.filetypes []) }))) + ]))