Compare commits

..

4 Commits

4 changed files with 77 additions and 45 deletions

View File

@@ -92,7 +92,7 @@ today() {
mkdir -p ~/notes/daily mkdir -p ~/notes/daily
if [ ! -f "$file" ]; then if [ ! -f "$file" ]; then
sed "s/YYYY-MM-DD/$(date +%Y-%m-%d)/g" \ sed "s/YYYY-MM-DD/$(date +%Y-%m-%d)/g" \
~/notes/templates/daily.md > "$file" ~/notes/templates/daily-template.md > "$file"
fi fi
${EDITOR} "$file" ${EDITOR} "$file"
} }
@@ -103,7 +103,7 @@ thisweek() {
mkdir -p ~/notes/weekly mkdir -p ~/notes/weekly
if [ ! -f "$week" ]; then if [ ! -f "$week" ]; then
sed "s/YYYY-WNN/$(date +%Y-W%V)/g" \ sed "s/YYYY-WNN/$(date +%Y-W%V)/g" \
~/notes/templates/weekly.md > "$week" ~/notes/templates/weekly-template.md > "$week"
fi fi
${EDITOR} "$week" ${EDITOR} "$week"
} }

View File

@@ -1,6 +1,6 @@
[user] [user]
name = Your Name name = Edwin van den Houdt
email = you@example.com email = eho@respellion.nl
[core] [core]
editor = nvim editor = nvim

View File

@@ -148,10 +148,10 @@ require('lazy').setup({
-- -------------------------------------------------------- -- --------------------------------------------------------
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
tag = 'v0.9.3',
build = ':TSUpdate', build = ':TSUpdate',
config = function() config = function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Install these parsers automatically
ensure_installed = { ensure_installed = {
'bash', 'lua', 'markdown', 'markdown_inline', 'bash', 'lua', 'markdown', 'markdown_inline',
'typescript', 'javascript', 'c_sharp', 'typescript', 'javascript', 'c_sharp',
@@ -166,62 +166,76 @@ require('lazy').setup({
-- -------------------------------------------------------- -- --------------------------------------------------------
-- LSP: language server protocol -- LSP: language server protocol
-- -------------------------------------------------------- -- --------------------------------------------------------
-- mason installs language servers for you. -- mason installs language servers.
-- mason-lspconfig bridges mason and nvim-lspconfig. -- mason-lspconfig makes mason-installed servers available to Neovim.
-- Neovim 0.11+ has a native vim.lsp.config API — no need to call
-- lspconfig.server.setup {} anymore.
{ {
'neovim/nvim-lspconfig', 'williamboman/mason.nvim',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function() config = function()
-- mason must be set up first
require('mason').setup() require('mason').setup()
end,
},
{
'williamboman/mason-lspconfig.nvim',
dependencies = { 'williamboman/mason.nvim' },
config = function()
require('mason-lspconfig').setup { require('mason-lspconfig').setup {
-- These servers are installed automatically -- These servers are installed automatically via mason
ensure_installed = { ensure_installed = {
'ts_ls', -- TypeScript / JavaScript 'ts_ls', -- TypeScript / JavaScript
'omnisharp', -- C# and F# 'omnisharp', -- C# and F#
'marksman', -- Markdown 'marksman', -- Markdown
'lua_ls', -- Lua (for editing this config) 'lua_ls', -- Lua (for editing this config)
}, },
} }
end,
},
{
-- nvim-lspconfig still provides default cmd/root detection per server.
-- We use it as a data source only — no setup() calls per server.
'neovim/nvim-lspconfig',
dependencies = { 'williamboman/mason-lspconfig.nvim' },
config = function()
-- Keymaps that only activate when an LSP attaches to a buffer -- Server-specific settings using the native 0.11 API.
-- vim.lsp.config(name, opts) sets config for a server.
-- vim.lsp.enable(name) starts it when the right filetype opens.
vim.lsp.config('ts_ls', {})
vim.lsp.config('omnisharp', {
-- Uncomment and point to your solution file if needed:
-- cmd = { 'omnisharp', '--solution-path', 'YourSolution.sln' },
})
vim.lsp.config('marksman', {})
vim.lsp.config('lua_ls', {
settings = {
Lua = {
-- Tell the Lua LSP about Neovim's vim global
diagnostics = { globals = { 'vim' } },
},
},
})
vim.lsp.enable({ 'ts_ls', 'omnisharp', 'marksman', 'lua_ls' })
-- Keymaps that activate only when an LSP attaches to a buffer
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
callback = function(event) callback = function(event)
local map = function(keys, func, desc) local map = function(keys, func, desc)
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = desc }) vim.keymap.set('n', keys, func, { buffer = event.buf, desc = desc })
end end
map('gd', vim.lsp.buf.definition, 'Go to definition') map('gd', vim.lsp.buf.definition, 'Go to definition')
map('gD', vim.lsp.buf.declaration, 'Go to declaration') map('gD', vim.lsp.buf.declaration, 'Go to declaration')
map('gr', vim.lsp.buf.references, 'Go to references') map('gr', vim.lsp.buf.references, 'Go to references')
map('K', vim.lsp.buf.hover, 'Hover documentation') map('K', vim.lsp.buf.hover, 'Hover documentation')
map('<leader>rn', vim.lsp.buf.rename, 'Rename symbol') map('<leader>rn', vim.lsp.buf.rename, 'Rename symbol')
map('<leader>ca', vim.lsp.buf.code_action, 'Code action') map('<leader>ca', vim.lsp.buf.code_action, 'Code action')
end, end,
}) })
-- Server-specific settings
local lspconfig = require 'lspconfig'
lspconfig.ts_ls.setup {}
lspconfig.omnisharp.setup {
-- Point to your solution file if needed
-- cmd = { 'omnisharp', '--solution-path', 'YourSolution.sln' },
}
lspconfig.marksman.setup {}
lspconfig.lua_ls.setup {
settings = {
Lua = {
-- Teach the Lua LSP about Neovim's globals
diagnostics = { globals = { 'vim' } },
},
},
}
end, end,
}, },

View File

@@ -0,0 +1,18 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"kanagawa.nvim": { "branch": "master", "commit": "8ad3b4cdcc804b332c32db8f9743667e1bb82b99" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0c2823e0418f3d9230ff8b201c976e84de1cb401" },
"mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" },
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
"nvim-lspconfig": { "branch": "master", "commit": "31026a13eefb20681124706a79fc1df6bf11ab27" },
"nvim-treesitter": { "branch": "main", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
}