Commit 42ddd058 authored by Tim van Deurzen's avatar Tim van Deurzen

Latest updates.

parent a920a0b6
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
org-agenda-skip-deadline-if-done t org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t org-agenda-skip-scheduled-if-done t
org-clock-rounding-minutes 5 org-clock-rounding-minutes 15
org-clock-persist t org-clock-persist t
org-clock-in-resume t org-clock-in-resume t
org-clock-persist-query-resume nil org-clock-persist-query-resume nil
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package) ;(package! some-package)
(package! evil-colemak-basics) (package! evil-colemak-basics :recipe (:branch "main"))
(package! org-super-agenda) (package! org-super-agenda)
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
email = tim@kompiler.org email = tim@kompiler.org
name = Tim van Deurzen name = Tim van Deurzen
[includeIf "gitdir:~/src/blockport/"]
path = ~/src/blockport/.gitconfig_bux
[includeIf "gitdir:~/src/bux/"]
path = ~/src/bux/.gitconfig_bux
[alias] [alias]
co = checkout co = checkout
br = branch br = branch
...@@ -15,12 +21,15 @@ ...@@ -15,12 +21,15 @@
[url "ssh://git@gitlab.dopey.blockport.io"] [url "ssh://git@gitlab.dopey.blockport.io"]
insteadOf = https://gitlab.dopey.blockport.io insteadOf = https://gitlab.dopey.blockport.io
[url "ssh://git@github.com-vdeurzen-bux/buxapp"]
insteadOf = https://github.com/buxapp
[core] [core]
editor = nvim editor = nvim
pager = delta pager = delta
[delta] [delta]
features = line-numbers decorations side-by-side features = line-numbers decorations
plus-style = "syntax bold auto" plus-style = "syntax bold auto"
minus-style = "syntax bold italic auto" minus-style = "syntax bold italic auto"
syntax-theme = "gruvbox-light" syntax-theme = "gruvbox-light"
......
local lsp_config = require("lspconfig")
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
capabilities.textDocument.completion.completionItem.snippetSupport = true
lsp_config.gopls.setup({
capabilities = capabilities,
settings = {
gopls = {
experimentalPostfixCompletions = true,
analyses = {
fieldalignment = true,
nilness = true,
unusedwrite = true,
unusedparams = true,
shadow = true,
unreachable = true,
bools = true,
},
staticcheck = true,
usePlaceholders = true,
codelenses = {
gc_details = true,
},
},
},
})
vim.cmd('set noexpandtab')
...@@ -4,3 +4,5 @@ require("keybindings") ...@@ -4,3 +4,5 @@ require("keybindings")
require("plugins") require("plugins")
require("lsp") require("lsp")
require("treesitter") require("treesitter")
require("snippets")
require("automagic")
...@@ -10,6 +10,7 @@ end ...@@ -10,6 +10,7 @@ end
local function basic_configuration() local function basic_configuration()
local options = { local options = {
winbar = "%=%m %f";
hidden = true; hidden = true;
fileformats = "unix,mac,dos"; fileformats = "unix,mac,dos";
modeline = true; modeline = true;
...@@ -31,7 +32,7 @@ local function basic_configuration() ...@@ -31,7 +32,7 @@ local function basic_configuration()
termguicolors = true; termguicolors = true;
background = "dark"; background = "dark";
ttyfast = true; ttyfast = true;
lazyredraw = true; -- lazyredraw = true;
listchars = "tab:»·,nbsp:+,trail:·,extends:→,precedes:←"; listchars = "tab:»·,nbsp:+,trail:·,extends:→,precedes:←";
showcmd = true; showcmd = true;
ruler = true; ruler = true;
...@@ -42,7 +43,7 @@ local function basic_configuration() ...@@ -42,7 +43,7 @@ local function basic_configuration()
wildmenu = true; wildmenu = true;
wildignore = "*.o,*.class,*.hi,*.pdf,*.git,*.blg,*.bbl,*.aux,*.gcno,*.gcda"; wildignore = "*.o,*.class,*.hi,*.pdf,*.git,*.blg,*.bbl,*.aux,*.gcno,*.gcda";
showmode = true; showmode = true;
laststatus = 2; laststatus = 3;
scrolloff = 7; scrolloff = 7;
cmdheight = 2; cmdheight = 2;
tabpagemax = 100; tabpagemax = 100;
......
...@@ -2,50 +2,154 @@ local lspkind = require("lspkind") ...@@ -2,50 +2,154 @@ local lspkind = require("lspkind")
lspkind.init() lspkind.init()
local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local luasnip = require("luasnip")
local cmp = require("cmp") local cmp = require("cmp")
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
--require("luasnip").lsp_expand(args.body) luasnip.lsp_expand(args.body)
require("snippy").expand_snippet(args.body) --require("snippy").expand_snippet(args.body)
end, end,
}, },
mapping = { mapping = {
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), ["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), ["<C-f>"] = cmp.mapping.scroll_docs(2),
["<C-e>"] = cmp.mapping({ ['<Down>'] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), { 'i' }),
i = cmp.mapping.abort(), ['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), { 'i' }),
c = cmp.mapping.close(), ['<C-n>'] = cmp.mapping({
}), c = function()
}, if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
sources = cmp.config.sources({ elseif luasnip.expand_or_jumpable() then
{ name = "nvim_lsp" }, luasnip.expand_or_jump()
{ name = "nvim_lua" }, elseif has_words_before() then
{ name = "path" }, cmp.complete()
{ name = "snippy" }, else
{ name = "buffer", keyword_length = 5 }, vim.api.nvim_feedkeys(t('<Down>'), 'n', true)
}), end
end,
formatting = { i = function(fallback)
format = lspkind.cmp_format({ if cmp.visible() then
with_text = true, cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
menu = { elseif luasnip.expand_or_jumpable() then
buffer = "[buf]", luasnip.expand_or_jump()
nvim_lsp = "[LSP]", elseif has_words_before() then
nvim_lua = "[api]", cmp.complete()
path = "[path]", else
luasnip = "[snip]", fallback()
}, end
}), end
}, }),
['<C-p>'] = cmp.mapping({
experimental = { c = function()
native_menu = false, if cmp.visible() then
ghost_text = true, cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
}, elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
vim.api.nvim_feedkeys(t('<Up>'), 'n', true)
end
end,
i = function(fallback)
if cmp.visible() then
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end
}),
["<C-e>"] = cmp.mapping.close(),
["<c-y>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
["<c-q>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, {
-- "i",
-- "s",
-- }),
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, {
-- "i",
-- "s",
-- }),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "nvim_lua" },
{ name = "path" },
--{ name = "snippy" },
{ name = "buffer", keyword_length = 5 },
}),
formatting = {
format = lspkind.cmp_format({
with_text = true,
menu = {
buffer = "[buf]",
nvim_lsp = "[LSP]",
nvim_lua = "[api]",
path = "[path]",
luasnip = "[snip]",
},
}),
},
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
experimental = {
native_menu = false,
ghost_text = true,
},
}) })
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
...@@ -31,7 +31,7 @@ local keymap = { ...@@ -31,7 +31,7 @@ local keymap = {
r = { "<Cmd>lua vim.lsp.buf.rename()<CR>", "rename" }, r = { "<Cmd>lua vim.lsp.buf.rename()<CR>", "rename" },
s = { "<Cmd>lua vim.lsp.buf.references()<CR>", "find" }, s = { "<Cmd>lua vim.lsp.buf.references()<CR>", "find" },
p = { "<cmd>lua vim.lsp.buf.hover()<CR>", "preview definition" }, p = { "<cmd>lua vim.lsp.buf.hover()<CR>", "preview definition" },
f = { "<Cmd>lua vim.lsp.buf.formatting()<CR>", "format" }, f = { "<Cmd>lua vim.lsp.buf.format({ async = true })<CR>", "format" },
d = { "<Cmd>lua vim.lsp.buf.definition()<CR>", "go to definition" }, d = { "<Cmd>lua vim.lsp.buf.definition()<CR>", "go to definition" },
i = { "<Cmd>lua vim.lsp.buf.implementation()<CR>", "go to definition" }, i = { "<Cmd>lua vim.lsp.buf.implementation()<CR>", "go to definition" },
t = { "<Cmd>LspTroubleToggle lsp_workspace_diagnostics<CR>", "open LspTrouble" }, t = { "<Cmd>LspTroubleToggle lsp_workspace_diagnostics<CR>", "open LspTrouble" },
......
This diff is collapsed.
This diff is collapsed.
require("luasnip.loaders.from_vscode").load({paths= {"~/.local/share/nvim/site/pack/packer/start/friendly-snippets/"}})
local ls = require("luasnip")
ls.filetype_extend("all", { "_" })
...@@ -3,10 +3,11 @@ ts_configs.setup { ...@@ -3,10 +3,11 @@ ts_configs.setup {
ensure_installed = { ensure_installed = {
'bash', 'bibtex', 'c', 'comment', 'cpp', 'css', 'go', 'haskell', 'bash', 'bibtex', 'c', 'comment', 'cpp', 'css', 'go', 'haskell',
'html', 'javascript', 'json', 'jsonc', 'julia', 'kotlin', 'latex', 'lua', 'ocaml', 'html', 'javascript', 'json', 'jsonc', 'julia', 'kotlin', 'latex', 'lua', 'ocaml',
'ocaml_interface', 'python', 'regex', 'rust', 'teal', 'toml', 'typescript', 'yaml', 'zig' 'ocaml_interface', 'python', 'regex', 'rust', 'teal', 'toml', 'typescript', 'yaml',
'zig', 'query',
}, },
highlight = {enable = true, use_languagetree = true}, highlight = { enable = true, use_languagetree = true },
indent = {enable = false}, indent = { enable = false },
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
...@@ -17,10 +18,30 @@ ts_configs.setup { ...@@ -17,10 +18,30 @@ ts_configs.setup {
} }
}, },
refactor = { refactor = {
smart_rename = {enable = true, keymaps = {smart_rename = "grr"}}, smart_rename = { enable = true, keymaps = { smart_rename = "grr" } },
highlight_definitions = {enable = true}, highlight_definitions = { enable = true },
highlight_current_scope = { enable = false } highlight_current_scope = { enable = false }
}--, },
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = 'o',
toggle_hl_groups = 'i',
toggle_injected_languages = 't',
toggle_anonymous_nodes = 'a',
toggle_language_display = 'I',
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
show_help = '?',
},
}
--,
--textobjects = { --textobjects = {
-- select = { -- select = {
-- enable = true, -- enable = true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment