feat(core): start on the clojure journey

Install all of the tools and config for clojure development. This adds
the first configz module that is not yet properly integrated and
automaticaly run with the `dotfiles` shell command.
This commit is contained in:
Ade Attwood 2023-04-25 21:00:23 +01:00
parent 894320aa4d
commit 3070940cd1
7 changed files with 47 additions and 4 deletions

1
.gitignore vendored
View file

@ -3,7 +3,6 @@
# Edit at https://www.toptal.com/developers/gitignore?templates=puppet,emacs,code,vim,linux # Edit at https://www.toptal.com/developers/gitignore?templates=puppet,emacs,code,vim,linux
### Application ### ### Application ###
modules
.resource_types .resource_types
info.rb info.rb
.rerun.json .rerun.json

36
modules/clojure.lua Normal file
View file

@ -0,0 +1,36 @@
-- Configz module for the clojure dev tools
local function install_clojure_lsp()
configz.download("/tmp/closure-lsp.zip", {
sha256 = "c23a5c9029b3a548a6b8e66a0662103c13e44f220ad8e3f97abf0b7c53a994b1",
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/2023.02.27-13.12.12/clojure-lsp-native-static-linux-amd64.zip",
})
configz.run "cd /tmp; unzip /tmp/closure-lsp.zip"
configz.file(os.getenv "HOME" .. "/.local/bin/clojure-lsp", { source = "/tmp/clojure-lsp" })
end
local function has_correct_version(command, version)
local ok, _ = configz.run(command .. " --version | grep " .. version)
return ok
end
local clojure_lsp_installed, clojure_lsp = configz.get_executable "clojure-lsp"
if not clojure_lsp_installed or not has_correct_version(clojure_lsp, "2023.02.27-13.12.12") then
install_clojure_lsp()
end
local function install_babashka()
configz.download("/tmp/babashka.tar.gz", {
sha256 = "46c866c28ea9d99a5544c75c554b0c1e22edfa20843d927d3c175b7021ca7252",
url = "https://github.com/babashka/babashka/releases/download/v1.3.176/babashka-1.3.176-linux-amd64.tar.gz",
})
configz.run "cd /tmp; tar -xzf babashka.tar.gz"
configz.file(os.getenv "HOME" .. "/.local/bin/bb", { source = "/tmp/bb" })
end
local bb_installed, bb = configz.get_executable "bb"
if not bb_installed or not has_correct_version(bb, "1.3.176") then
install_babashka()
end

View file

@ -1,5 +1,6 @@
" Set leader as space bar " Set leader as space bar
let mapleader="\<Space>" let mapleader="\<Space>"
let maplocalleader="\<Space>"
" Use the system clipboard with yank and paste " Use the system clipboard with yank and paste
set clipboard=unnamedplus set clipboard=unnamedplus

View file

@ -81,7 +81,12 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, {
desc = "Lint the buffer", desc = "Lint the buffer",
pattern = "*", pattern = "*",
callback = function() callback = function()
lint.try_lint('cspell') -- Only try and run spell checking on buffers that have a filetype. This is
-- mainly to disable spell checking in vim lsp popup buffers.
if vim.bo.filetype ~= "" then
lint.try_lint('cspell')
end
lint.try_lint() lint.try_lint()
end, end,
}) })

View file

@ -14,6 +14,7 @@ local servers = {
}, },
html = {}, html = {},
cssls = {}, cssls = {},
clojure_lsp = {},
emmet_ls = { emmet_ls = {
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "scss", "eruby" }, filetypes = { "html", "typescriptreact", "javascriptreact", "css", "scss", "eruby" },
}, },

View file

@ -6,7 +6,7 @@ require'nvim-treesitter.configs'.setup {
enable = true, enable = true,
additional_vim_regex_highlighting = true, additional_vim_regex_highlighting = true,
}, },
ensure_installed = { ensure_installed = {
"typescript", "javascript", "tsx", "php", "html", "go", "org" "typescript", "javascript", "tsx", "php", "html", "go", "org", "clojure"
}, },
} }

View file

@ -61,6 +61,7 @@ class core::vim {
'vim-tmux-navigator' => { url => 'https://github.com/christoomey/vim-tmux-navigator.git' }, 'vim-tmux-navigator' => { url => 'https://github.com/christoomey/vim-tmux-navigator.git' },
'vim-fugitive' => { url => 'https://github.com/tpope/vim-fugitive.git' }, 'vim-fugitive' => { url => 'https://github.com/tpope/vim-fugitive.git' },
'vim-rhubarb' => { url => 'https://github.com/tpope/vim-rhubarb.git' }, 'vim-rhubarb' => { url => 'https://github.com/tpope/vim-rhubarb.git' },
'conjure' => { url => 'https://github.com/Olical/conjure.git' }
} }
create_resources(core::vim::plugin_start, $plugins_start) create_resources(core::vim::plugin_start, $plugins_start)