diff --git a/dot_config/broot/launcher/bash/br b/dot_config/broot/launcher/bash/br new file mode 120000 index 0000000..394eaed --- /dev/null +++ b/dot_config/broot/launcher/bash/br @@ -0,0 +1 @@ +/home/jan/.local/share/broot/launcher/bash/1 \ No newline at end of file diff --git a/dot_config/broot/launcher/installed-v4 b/dot_config/broot/launcher/installed-v4 new file mode 100644 index 0000000..3f026af --- /dev/null +++ b/dot_config/broot/launcher/installed-v4 @@ -0,0 +1,4 @@ + +This file tells broot the installation of the br function was done. +If there's a problem and you want to install it again run + broot -- install diff --git a/dot_config/fish/functions/br.fish b/dot_config/fish/functions/br.fish new file mode 100644 index 0000000..d815b33 --- /dev/null +++ b/dot_config/fish/functions/br.fish @@ -0,0 +1,19 @@ + +# This script was automatically generated by the broot program +# More information can be found in https://github.com/Canop/broot +# This function starts broot and executes the command +# it produces, if any. +# It's needed because some shell commands, like `cd`, +# have no useful effect if executed in a subshell. +function br --wraps=broot + set -l cmd_file (mktemp) + if broot --outcmd $cmd_file $argv + read --local --null cmd < $cmd_file + rm -f $cmd_file + eval $cmd + else + set -l code $status + rm -f $cmd_file + return $code + end +end diff --git a/dot_config/nvim/init.lua.tmpl b/dot_config/nvim/init.lua.tmpl index 0f7080d..3de27c3 100644 --- a/dot_config/nvim/init.lua.tmpl +++ b/dot_config/nvim/init.lua.tmpl @@ -161,7 +161,7 @@ o.wildignore = 'deps,.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.DS_Store,*.aux,*.out,*.toc' vim.cmd([[ -au BufRead,BufNewFile *.md set tw=80 syntax=markdown +au BufRead,BufNewFile *.md set spell tw=80 syntax=markdown ]]) vim.g.markdown_recommended_style = 0 diff --git a/dot_config/nvim/lua/plugins/coding.lua.tmpl b/dot_config/nvim/lua/plugins/coding.lua.tmpl index a26f9bc..338f2e6 100644 --- a/dot_config/nvim/lua/plugins/coding.lua.tmpl +++ b/dot_config/nvim/lua/plugins/coding.lua.tmpl @@ -1,36 +1,5 @@ return { {{- if eq .chezmoi.os "openbsd" }} - -- snippets - { - "L3MON4D3/LuaSnip", - build = "gmake install_jsregexp", - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - require("luasnip.loaders.from_snipmate").lazy_load() - end, - }, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - -- stylua: ignore - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - }, - }, - -- auto completion { "hrsh7th/nvim-cmp", @@ -40,7 +9,13 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", + { + "garymjr/nvim-snippets", + opts = { + friendly_snippets = true, + }, + dependencies = { "rafamadriz/friendly-snippets" }, + }, }, opts = function() vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) @@ -72,7 +47,6 @@ return { TypeParameter = "󰅲", } - local luasnip = require('luasnip') local cmp = require("cmp") local defaults = require("cmp.config.default")() return { @@ -81,7 +55,7 @@ return { }, snippet = { expand = function(args) - luasnip.lsp_expand(args.body) + vim.snippet.expand(args.body) end, }, mapping = cmp.mapping.preset.insert({ @@ -103,7 +77,7 @@ return { }), sources = cmp.config.sources({ { name = "nvim_lsp", keyword_length = 1 }, - { name = "luasnip", keyword_length = 2 }, + { name = "snippets" }, { name = "path" }, }, { { name = "buffer", keyword_length = 3 }, @@ -116,7 +90,7 @@ return { vim_item.menu = ({ buffer = "[Buffer]", nvim_lsp = "[LSP]", - luasnip = "[LuaSnip]", + snippets = "[Snippets]", nvim_lua = "[Lua]", latex_symbols = "[LaTeX]", })[entry.source.name] @@ -131,6 +105,26 @@ return { sorting = defaults.sorting, } end, + keys = { + { + "", + function() + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + { + "", + function() + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + }, config = function(_, opts) for _, source in ipairs(opts.sources) do source.group_index = source.group_index or 1