update
This commit is contained in:
parent
554a4373f4
commit
d0ad8b62ab
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
hello
|
hello
|
||||||
|
man-pages
|
||||||
|
man-pages-posix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
../../modules/home-manager/zoxide
|
../../modules/home-manager/zoxide
|
||||||
../../modules/home-manager/irssi
|
../../modules/home-manager/irssi
|
||||||
../../modules/home-manager/email
|
../../modules/home-manager/email
|
||||||
|
../../modules/home-manager/zk
|
||||||
../../modules/home-manager/password-store
|
../../modules/home-manager/password-store
|
||||||
];
|
];
|
||||||
home.username = "mthomson";
|
home.username = "mthomson";
|
||||||
@ -19,7 +20,6 @@
|
|||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
ZK_NOTEBOOK_DIR = "notes";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
'folke/lazydev.nvim',
|
||||||
|
ft = 'lua',
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'Bilal2453/luvit-meta', lazy = true },
|
||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
cmd = 'LspInfo',
|
cmd = 'LspInfo',
|
||||||
@ -25,26 +35,20 @@ return {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
callback = function()
|
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||||
local clients = vim.lsp.get_clients()
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
local id = client.id
|
|
||||||
vim.lsp.completion.enable(true, id, 1, { autotrigger = true })
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Server configs
|
-- Server configs
|
||||||
local lsp = require('lspconfig')
|
local lsp = require('lspconfig')
|
||||||
|
|
||||||
-- vue
|
-- vue
|
||||||
lsp.volar.setup({
|
lsp.volar.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- typescript / javascript
|
-- typescript / javascript
|
||||||
require'lspconfig'.ts_ls.setup{
|
require'lspconfig'.ts_ls.setup{
|
||||||
|
capabilities = capabilities,
|
||||||
init_options = {
|
init_options = {
|
||||||
plugins = {
|
plugins = {
|
||||||
{
|
{
|
||||||
@ -59,37 +63,126 @@ return {
|
|||||||
|
|
||||||
-- eslint
|
-- eslint
|
||||||
lsp.eslint.setup({
|
lsp.eslint.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- tailwind
|
-- tailwind
|
||||||
lsp.tailwindcss.setup({
|
lsp.tailwindcss.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
root_dir = lsp.util.root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts')
|
root_dir = lsp.util.root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts')
|
||||||
})
|
})
|
||||||
|
|
||||||
-- html
|
-- html
|
||||||
lsp.html.setup({
|
lsp.html.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- go
|
-- go
|
||||||
lsp.gopls.setup({
|
lsp.gopls.setup({
|
||||||
settings = {
|
capabilities = capabilities,
|
||||||
gopls = {
|
|
||||||
completeFunctionCalls = false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
lsp.golangci_lint_ls.setup({
|
lsp.golangci_lint_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- templ
|
-- templ
|
||||||
vim.filetype.add({ extension = { templ = "templ" } })
|
vim.filetype.add({ extension = { templ = "templ" } })
|
||||||
lsp.templ.setup({})
|
lsp.templ.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
|
||||||
lsp.lua_ls.setup({})
|
lsp.lua_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
|
||||||
lsp.nil_ls.setup({})
|
lsp.nil_ls.setup({
|
||||||
lsp.ccls.setup({})
|
capabilities = capabilities,
|
||||||
lsp.astro.setup({})
|
})
|
||||||
|
|
||||||
|
lsp.ccls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
lsp.astro.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
lsp.cssls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
build = (function()
|
||||||
|
-- Build Step is needed for regex support in snippets.
|
||||||
|
-- This step is not supported in many windows environments.
|
||||||
|
-- Remove the below condition to re-enable on windows.
|
||||||
|
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return 'make install_jsregexp'
|
||||||
|
end)(),
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
config = function()
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- See `:help cmp`
|
||||||
|
local cmp = require 'cmp'
|
||||||
|
local luasnip = require 'luasnip'
|
||||||
|
luasnip.config.setup {}
|
||||||
|
|
||||||
|
cmp.setup {
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||||
|
mapping = cmp.mapping.preset.insert {
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||||
|
['<C-Space>'] = cmp.mapping.complete {},
|
||||||
|
['<C-l>'] = cmp.mapping(function()
|
||||||
|
if luasnip.expand_or_locally_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<C-h>'] = cmp.mapping(function()
|
||||||
|
if luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{
|
||||||
|
name = 'lazydev',
|
||||||
|
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||||
|
group_index = 0,
|
||||||
|
},
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ return { -- Collection of various small independent plugins/modules
|
|||||||
keymap("n", "<leader>fg", pick.builtin.grep_live, { noremap = true, silent = true })
|
keymap("n", "<leader>fg", pick.builtin.grep_live, { noremap = true, silent = true })
|
||||||
keymap("n", "<leader>fwg", function()
|
keymap("n", "<leader>fwg", function()
|
||||||
local wrd = vim.fn.expand("<cword>")
|
local wrd = vim.fn.expand("<cword>")
|
||||||
pick.builtin.grep_live({ pattern = wrd })
|
pick.builtin.grep({ pattern = wrd })
|
||||||
end, { noremap = true, silent = true })
|
end, { noremap = true, silent = true })
|
||||||
|
|
||||||
-- require('mini.base16').setup({
|
-- require('mini.base16').setup({
|
||||||
@ -107,8 +107,6 @@ return { -- Collection of various small independent plugins/modules
|
|||||||
-- saturation = 'high'
|
-- saturation = 'high'
|
||||||
-- })
|
-- })
|
||||||
|
|
||||||
require('mini.completion').setup()
|
|
||||||
|
|
||||||
require('mini.splitjoin').setup()
|
require('mini.splitjoin').setup()
|
||||||
|
|
||||||
require('mini.trailspace').setup()
|
require('mini.trailspace').setup()
|
||||||
|
23
modules/home-manager/neovim/nvim/lua/plugins/zk.lua
Normal file
23
modules/home-manager/neovim/nvim/lua/plugins/zk.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
"zk-org/zk-nvim",
|
||||||
|
config = function()
|
||||||
|
require("zk").setup({
|
||||||
|
picker = "minipick",
|
||||||
|
})
|
||||||
|
local opts = { noremap=true, silent=false }
|
||||||
|
|
||||||
|
-- Create a new note after asking for its title.
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>zn", "<Cmd>ZkNew { title = vim.fn.input('Title: ') }<CR>", opts)
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>zd", "<Cmd>ZkNew { dir = \"journal/daily\" }<CR>", opts)
|
||||||
|
|
||||||
|
-- Open notes.
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>zo", "<Cmd>ZkNotes { sort = { 'modified' } }<CR>", opts)
|
||||||
|
-- Open notes associated with the selected tags.
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>zt", "<Cmd>ZkTags<CR>", opts)
|
||||||
|
|
||||||
|
-- Search for the notes matching a given query.
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>", opts)
|
||||||
|
-- Search for the notes matching the current visual selection.
|
||||||
|
vim.api.nvim_set_keymap("v", "<leader>zf", ":'<,'>ZkMatch<CR>", opts)
|
||||||
|
end
|
||||||
|
}
|
30
modules/home-manager/zk/default.nix
Normal file
30
modules/home-manager/zk/default.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
zk = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
notebook = {
|
||||||
|
dir = "~/notes";
|
||||||
|
};
|
||||||
|
extra = {
|
||||||
|
author = "Michael Thomson";
|
||||||
|
};
|
||||||
|
alias = {
|
||||||
|
daily = "zk new --no-input \"$ZK_NOTEBOOK_DIR/journal/daily\"";
|
||||||
|
};
|
||||||
|
group = {
|
||||||
|
daily = {
|
||||||
|
paths = ["journal/daily"];
|
||||||
|
note = {
|
||||||
|
filename = "{{format-date now '%Y-%m-%d'}}";
|
||||||
|
extension = "md";
|
||||||
|
template = "daily.md";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,6 +1,11 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
ZK_NOTEBOOK_DIR = "\${HOME}/notes";
|
||||||
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
zsh = {
|
zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user