Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
6308be20b8 |
|
@ -1,14 +1,15 @@
|
||||||
[*.lua]
|
[*]
|
||||||
# [basic]
|
|
||||||
|
|
||||||
# optional space/tab
|
# optional space/tab
|
||||||
indent_style = space
|
indent_style = space
|
||||||
# if indent_style is space, this is valid
|
# if indent_style is space, this is valid
|
||||||
indent_size = 4
|
indent_size = 2
|
||||||
# if indent_style is tab, this is valid
|
# if indent_style is tab, this is valid
|
||||||
tab_width = 4
|
tab_width = 2
|
||||||
# none/single/double
|
# none/single/double
|
||||||
quote_style = none
|
quote_style = double
|
||||||
|
|
||||||
|
[*.lua]
|
||||||
|
# [basic]
|
||||||
|
|
||||||
continuation_indent = 4
|
continuation_indent = 4
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
(local lazypath (.. (vim.fn.stdpath "data") "/lazy/lazy.nvim"))
|
(let [lazypath (.. (vim.fn.stdpath "data") "/lazy/lazy.nvim")]
|
||||||
|
(if (not (vim.loop.fs_stat lazypath))
|
||||||
(if (not (vim.loop.fs_stat lazypath))
|
|
||||||
(vim.fn.system
|
(vim.fn.system
|
||||||
["git"
|
["git"
|
||||||
"clone"
|
"clone"
|
||||||
|
@ -8,6 +7,7 @@
|
||||||
"https://github.com/folke/lazy.nvim.git"
|
"https://github.com/folke/lazy.nvim.git"
|
||||||
"--branch=stable"
|
"--branch=stable"
|
||||||
lazypath]))
|
lazypath]))
|
||||||
|
(vim.opt.rtp:prepend lazypath))
|
||||||
|
|
||||||
(let [lazy (require :lazy)]
|
(let [lazy (require :lazy)]
|
||||||
(lazy.setup
|
(lazy.setup
|
||||||
|
@ -19,58 +19,16 @@
|
||||||
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
||||||
" && cmake --build build --config Release"
|
" && cmake --build build --config Release"
|
||||||
" && cmake --install build --prefix build" )}
|
" && cmake --install build --prefix build" )}
|
||||||
;; TODO LSP configurations...
|
{:url "https://github.com/neovim/nvim-lspconfig"
|
||||||
;; {:url "https://github.com/neovim/nvim-lspconfig"
|
:dependencies
|
||||||
;; :dependencies
|
["https://github.com/williamboman/mason.nvim"
|
||||||
;; ["https://github.com/williamboman/mason.nvim"
|
"williamboman/mason-lspconfig.nvim"
|
||||||
;; "williamboman/mason-lspconfig.nvim"
|
{:url "https://github.com/j-hui/fidget.nvim"
|
||||||
;; {:url "https://github.com/j-hui/fidget.nvim"
|
:tag "legacy"
|
||||||
;; :tag "legacy"
|
:opts {}}
|
||||||
;; :opts {}} ; NOTE: `opts = {}` is the same as calling `require("fidget").setup({})`
|
"folke/neodev.nvim"
|
||||||
;; "folke/neodev.nvim"]}
|
]}
|
||||||
]))
|
]))
|
||||||
|
|
||||||
(let [telescope (require "telescope")]
|
(let [telescope (require "telescope")]
|
||||||
(pcall (telescope.load_extension :fzf)))
|
(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})))
|
|
||||||
;; ]))
|
|
||||||
|
|
42
init.lua
42
init.lua
|
@ -1,13 +1,49 @@
|
||||||
local hotpot_path = vim.fn.stdpath('data') .. '/lazy/hotpot.nvim'
|
local hotpot_path = vim.fn.stdpath('data') .. '/lazy/hotpot.nvim'
|
||||||
|
|
||||||
vim.opt.rtp:prepend(hotpot_path)
|
|
||||||
|
|
||||||
if vim.fn.empty(vim.fn.glob(hotpot_path)) > 0 then
|
if vim.fn.empty(vim.fn.glob(hotpot_path)) > 0 then
|
||||||
print("Could not find hotpot.nvim, cloning new copy to", hotpot_path)
|
print("Could not find hotpot.nvim, cloning new copy to", hotpot_path)
|
||||||
vim.fn.system({'git', 'clone',
|
vim.fn.system({'git', 'clone',
|
||||||
'https://github.com/rktjmp/hotpot.nvim', hotpot_path})
|
'https://github.com/rktjmp/hotpot.nvim', hotpot_path})
|
||||||
vim.cmd("helptags " .. hotpot_path .. "/doc")
|
vim.cmd("helptags " .. hotpot_path .. "/doc")
|
||||||
end
|
end
|
||||||
|
vim.opt.rtp:prepend(hotpot_path)
|
||||||
|
|
||||||
require("hotpot")
|
require("hotpot")
|
||||||
require("init")
|
require("init")
|
||||||
|
|
||||||
|
local servers =
|
||||||
|
{lua_ls = {Lua = {workspace = {checkThirdParty = false}, telemetry = {enable = false}}}
|
||||||
|
-- TODO :fennel_language_server {}
|
||||||
|
-- TODO :bash_language_server {}
|
||||||
|
-- TODO :jq {}
|
||||||
|
}
|
||||||
|
|
||||||
|
local on_attach = function (_, bufnr)
|
||||||
|
local nmap = function (keys, fn, desc)
|
||||||
|
vim.keymap.set(keys, fn, {buffer = bufnr, desc = desc})
|
||||||
|
end
|
||||||
|
local 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", function ()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
end, "Format current buffer with LSP")
|
||||||
|
end
|
||||||
|
|
||||||
|
require("neodev").setup()
|
||||||
|
require("mason").setup()
|
||||||
|
|
||||||
|
local mason_lspconfig = require("mason-lspconfig")
|
||||||
|
mason_lspconfig.setup({ensure_installed = vim.tbl_keys(servers)})
|
||||||
|
mason_lspconfig.setup_handlers({
|
||||||
|
function (server_name)
|
||||||
|
local server = require(server_name)
|
||||||
|
server.setup({
|
||||||
|
capabilities = vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = servers[server_name],
|
||||||
|
filetypes = (servers[server_name] or {}).filetypes,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
{
|
{
|
||||||
|
"editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||||
"hotpot.nvim": { "branch": "master", "commit": "026eba9596b506ab6f807fd4aa93cd5f76255725" },
|
"hotpot.nvim": { "branch": "master", "commit": "026eba9596b506ab6f807fd4aa93cd5f76255725" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" },
|
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "866b6b6e687a93ba98851a03a74bf6d9211b7299" },
|
"neodev.nvim": { "branch": "main", "commit": "f57e5210d450b47aa02ea6d9e50a37414f570b4c" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" },
|
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
|
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "1228f3b15ca3d9b95dcb92efda6a3448871030bd" }
|
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }
|
||||||
}
|
}
|
Loading…
Reference in a new issue