From c3e98662e367049d32a9a27805c620c178be603d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 31 Oct 2023 17:32:29 +0100 Subject: added plantuml support with plugin --- config/essentials/nvim/lua/user/packer.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/packer.lua b/config/essentials/nvim/lua/user/packer.lua index 36f9ec0..ed2bbf1 100644 --- a/config/essentials/nvim/lua/user/packer.lua +++ b/config/essentials/nvim/lua/user/packer.lua @@ -45,13 +45,20 @@ return require('packer').startup(function(use) use('christoomey/vim-tmux-navigator') - -- utils - use('godlygeek/tabular') - use('renerocksai/calendar-vim') - use('ojroques/vim-oscyank', {branch = "main"}) - use("potamides/pantran.nvim") - use('alx741/vinfo') - -- use('github/copilot.vim') + -- utils + use('godlygeek/tabular') + use('renerocksai/calendar-vim') + use('ojroques/vim-oscyank', {branch = "main"}) + use("potamides/pantran.nvim") + use('alx741/vinfo') + use('sheerun/vim-polyglot') + -- use('github/copilot.vim') + -- + use { + 'https://gitlab.com/itaranto/plantuml.nvim', + tag = '*', + config = function() require('plantuml').setup() end + } -- objects use('michaeljsmith/vim-indent-object') -- cgit v1.2.3 From cb92f16cd26cbf111b8c5271ac8b5146a3ced00d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 18:33:18 +0100 Subject: added 'html' lsp support in php files --- config/essentials/nvim/after/plugin/luasnip.lua | 324 ++++++++++++------------ config/essentials/nvim/lua/user/cmp/html.lua | 5 +- 2 files changed, 165 insertions(+), 164 deletions(-) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index 319a68c..5cf54d5 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -29,33 +29,33 @@ vim.keymap.set({"i", "s"}, "", "luasnip-expand-or-jump", { noremap = vim.keymap.set({"i", "s"}, "", "luasnip-jump-prev", { noremap = true }) vim.keymap.set({"i", "s"}, "", "luasnip-next-choice", { noremap = true }) vim.keymap.set("n", "s", function() - ls.cleanup() - vim.cmd("source ~/.config/nvim/after/plugin/luasnip.lua") - print("snippets reloaded.") + ls.cleanup() + vim.cmd("source ~/.config/nvim/after/plugin/luasnip.lua") + print("snippets reloaded.") end, { noremap = true }) ls.add_snippets("lua", { - -- print - s("pt", fmt("print({}){}", { i(1, "\"Hello World!\"") , i(0) })), - -- local function - parse("lf", "local $1 = function($2)\n\t$3\nend$0", {}), - -- require - s("lrq", fmt("local {} = require('{}')", { i(1), rep(1) })), - parse("rq", "require('$1')$0", {}), - parse("rqs", "require('$1').setup {\n\t$2\n}$0", {}), - parse("use", "use('$1')$0", {}), - -- function - s("fn", fmt( - [[ - function {}({}) - {} - end{} - ]], - { i(1), i(2), i(3), i(0) })), - parse("sn", "s(\"$1\", fmt(\n[[\n$2\n]],\n{ $3 })),$0", {}), + -- print + s("pt", fmt("print({}){}", { i(1, "\"Hello World!\"") , i(0) })), + -- local function + parse("lf", "local $1 = function($2)\n\t$3\nend$0", {}), + -- require + s("lrq", fmt("local {} = require('{}')", { i(1), rep(1) })), + parse("rq", "require('$1')$0", {}), + parse("rqs", "require('$1').setup {\n\t$2\n}$0", {}), + parse("use", "use('$1')$0", {}), + -- function + parse("fn", + [[ + function $1($2) + end$0 + ]], {}), + parse("sn", "s(\"$1\", fmt(\n[[\n$2\n]],\n{ $3 })),$0", {}), }) -ls.add_snippets("html", { +local languages = {'php', 'html'} +for language = 1,#languages do +ls.add_snippets(languages[language], { s("", fmt( [[ @@ -64,166 +64,166 @@ ls.add_snippets("html", { - {}{} + {}

{}

{} ]], - {i(1, "title"), i(2), i(3, "Header"), i(0)})), - s("sty", fmt( + {i(1, "title"), rep(2), i(0)})), + parse("sty", [[ - {} - ]], - { i(1), i(0) })), + $0 + ]], {}), }) +end ls.add_snippets("java", { - -- function - s("fn", fmt( - [[ - {}{} {}({}) - {{ - {} - }} - ]], - { - c(1, {t "public ", t "private ", t ""}), - i(2, "type"), - i(3, "f"), - i(4), i(0) - })), - -- setter function - s("psv", fmt( - [[ - public class Main - {{ - public static void main (String[] args) - {{ - {} - }} - }} - ]], - { i(0) })), - -- constructor - s("class", fmt( - [[ - {}class {} - {{ - {} - }}{} - ]], - { c(1, {t "public ", t "private ", t ""}), i(2), i(3), i(0)})), - -- StringBuilder - s("sb", fmt( - [[ - public void print() - {{ - StringBuilder sb = new StringBuilder(30); - sb.append({}); - sb.append(", ").append({});{} - System.out.print(sb.toString()); - }}{} - ]], - { i(1), i(2), i(3), i(0)})), - -- print - parse("pt", "System.out.println($1);$0", {}), - parse("pti", "System.out.println(\"$1: \" + $1);$0", {}), - -- quickies - s("pr", t "private "), - s("ob", fmt( - [[ - {} {} = new {}({}); - {} - ]], - { i(1), i(2), rep(1), i(3), i(0) })), - parse("abs", "Math.abs($1);$0", {}), + -- function + s("fn", fmt( + [[ + {}{} {}({}) + {{ + {} + }} + ]], + { + c(1, {t "public ", t "private ", t ""}), + i(2, "type"), + i(3, "f"), + i(4), i(0) + })), + -- setter function + s("psv", fmt( + [[ + public class Main + {{ + public static void main (String[] args) + {{ + {} + }} + }} + ]], + { i(0) })), + -- constructor + s("class", fmt( + [[ + {}class {} + {{ + {} + }}{} + ]], + { c(1, {t "public ", t "private ", t ""}), i(2), i(3), i(0)})), + -- StringBuilder + s("sb", fmt( + [[ + public void print() + {{ + StringBuilder sb = new StringBuilder(30); + sb.append({}); + sb.append(", ").append({});{} + System.out.print(sb.toString()); + }}{} + ]], + { i(1), i(2), i(3), i(0)})), + -- print + parse("pt", "System.out.println($1);$0", {}), + parse("pti", "System.out.println(\"$1: \" + $1);$0", {}), + -- quickies + s("pr", t "private "), + s("ob", fmt( + [[ + {} {} = new {}({}); + {} + ]], + { i(1), i(2), rep(1), i(3), i(0) })), + parse("abs", "Math.abs($1);$0", {}), }) ls.add_snippets("sh", { - s("TD", t "THISDIR=\"$(dirname \"$(readlink -f \"$0\")\")\""), - parse("pf", ">&2 printf '$1\\n'$0", {}), - parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), - -- Functions - parse("rchar", - [[ - read_char () - { - old_stty_cfg=$(stty -g) - stty raw -echo - dd ibs=1 count=1 2> /dev/null - stty \$old_stty_cfg - } - ]], {}), - parse("fdie", - [[ - die () { >&2 printf '%s\n' "\$@"; exit 1; } - ]], {}), - parse("flogn", - [[ - logn () { >&2 printf '%s\n' "\$@"; } - ]], {}), - parse("flog", - [[ - log () { >&2 printf '%s' "\$@"; } - ]], {}), - s("inp", fmt( - [[ - test -z "${{{}:=$1}}" && - {}="$(cat /dev/stdin)" - echo "{}: ${}" 1>&2{} - ]], - { i(1), rep(1), rep(1), rep(1), i(0) })), + s("TD", t "THISDIR=\"$(dirname \"$(readlink -f \"$0\")\")\""), + parse("pf", ">&2 printf '$1\\n'$0", {}), + parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), + -- Functions + parse("rchar", + [[ + read_char () + { + old_stty_cfg=$(stty -g) + stty raw -echo + dd ibs=1 count=1 2> /dev/null + stty \$old_stty_cfg + } + ]], {}), + parse("fdie", + [[ + die () { >&2 printf '%s\n' "\$@"; exit 1; } + ]], {}), + parse("flogn", + [[ + logn () { >&2 printf '%s\n' "\$@"; } + ]], {}), + parse("flog", + [[ + log () { >&2 printf '%s' "\$@"; } + ]], {}), + s("inp", fmt( + [[ + test -z "${{{}:=$1}}" && + {}="$(cat /dev/stdin)" + echo "{}: ${}" 1>&2{} + ]], + { i(1), rep(1), rep(1), rep(1), i(0) })), }) ls.add_snippets("javascript", { - -- print - s("pt", fmt("console.log({});{}", { i(1, "\"Hello World!\"") , i(0) })), - s("rq", fmt("const {} = require('{}');", { i(1), rep(1) })), - s("dbconn", fmt( - [[ - let conn = null; - try {{ - conn = await dbConnect();{} - conn.end() - }} catch(err) {{ - console.error('Error:', err); - }} - ]], - { i(0) })), - s("apr", fmt( - [[ - app.get('{}', (req, res) => {{ - {} - }});{} - ]], - { i(1), i(2, "res.send(\"Hello world!\")"), i(0) })), - s("cerr", t "console.error('Error:', err);"), - s("gel", fmt( - [[ - let {} = document.getElementById('{}');{} - ]], - { i(1), rep(1), i(0) })), + -- print + s("pt", fmt("console.log({});{}", { i(1, "\"Hello World!\"") , i(0) })), + s("rq", fmt("const {} = require('{}');", { i(1), rep(1) })), + s("dbconn", fmt( + [[ + let conn = null; + try {{ + conn = await dbConnect();{} + conn.end() + }} catch(err) {{ + console.error('Error:', err); + }} + ]], + { i(0) })), + s("apr", fmt( + [[ + app.get('{}', (req, res) => {{ + {} + }});{} + ]], + { i(1), i(2, "res.send(\"Hello world!\")"), i(0) })), + s("cerr", t "console.error('Error:', err);"), + s("gel", fmt( + [[ + let {} = document.getElementById('{}');{} + ]], + { i(1), rep(1), i(0) })), }) ls.add_snippets("cs", { - parse("cw", "Console.WriteLine($1);$0"), + parse("cw", "Console.WriteLine($1);$0"), }) ls.add_snippets("telekasten", { - --link - parse("ln", "[[$0]]", {}), - s("cln", fmt( - [[ - [{}]({}){} - ]], - { - i(1), - f(function () - return vim.fn.getreg('+') - end), - i(0) - } - )), + --link + parse("ln", "[[$0]]", {}), + s("cln", fmt( + [[ + [{}]({}){} + ]], + { + i(1), + f(function () + return vim.fn.getreg('+') + end), + i(0) + } + )), }) diff --git a/config/essentials/nvim/lua/user/cmp/html.lua b/config/essentials/nvim/lua/user/cmp/html.lua index 69ed29d..d3c99df 100644 --- a/config/essentials/nvim/lua/user/cmp/html.lua +++ b/config/essentials/nvim/lua/user/cmp/html.lua @@ -2,6 +2,7 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.html.setup { - capabilities = capabilities, +require 'lspconfig'.html.setup { + capabilities = capabilities, + filetypes = { "html", "php" }, } -- cgit v1.2.3 From 8a4d4db609f2ab37ae7e54b4210535c09eeb0e6c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 3 Nov 2023 13:39:12 +0100 Subject: cleanup --- config/essentials/nvim/lua/user/packer.lua | 49 ++++++++++++------------------ 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/packer.lua b/config/essentials/nvim/lua/user/packer.lua index ed2bbf1..8091d85 100644 --- a/config/essentials/nvim/lua/user/packer.lua +++ b/config/essentials/nvim/lua/user/packer.lua @@ -4,11 +4,11 @@ return require('packer').startup(function(use) -- files use { 'nvim-telescope/telescope.nvim', tag = '0.1.2', - requires = { {'nvim-lua/plenary.nvim'} } + requires = { { 'nvim-lua/plenary.nvim' } } } - use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } - use {'nvim-telescope/telescope-ui-select.nvim' } - use {'nvim-telescope/telescope-media-files.nvim'} + use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } + use { 'nvim-telescope/telescope-ui-select.nvim' } + use { 'nvim-telescope/telescope-media-files.nvim' } use('nvim-telescope/telescope-symbols.nvim') use('theprimeagen/harpoon') @@ -18,20 +18,11 @@ return require('packer').startup(function(use) use { 'uZer/pywal16.nvim', as = 'pywal16' } use('norcalli/nvim-colorizer.lua') - use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) use('nvim-treesitter/playground') use('theRealCarneiro/hyprland-vim-syntax') use('mbbill/undotree') - use { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - requires = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - } - } use('tpope/vim-capslock') use('tpope/vim-commentary') @@ -45,20 +36,20 @@ return require('packer').startup(function(use) use('christoomey/vim-tmux-navigator') - -- utils - use('godlygeek/tabular') - use('renerocksai/calendar-vim') - use('ojroques/vim-oscyank', {branch = "main"}) - use("potamides/pantran.nvim") - use('alx741/vinfo') - use('sheerun/vim-polyglot') - -- use('github/copilot.vim') - -- - use { - 'https://gitlab.com/itaranto/plantuml.nvim', - tag = '*', - config = function() require('plantuml').setup() end - } + -- utils + use('godlygeek/tabular') + use('renerocksai/calendar-vim') + use('ojroques/vim-oscyank', { branch = "main" }) + use("potamides/pantran.nvim") + use('alx741/vinfo') + use('sheerun/vim-polyglot') + -- use('github/copilot.vim') + -- + use { + 'https://gitlab.com/itaranto/plantuml.nvim', + tag = '*', + config = function() require('plantuml').setup() end + } -- objects use('michaeljsmith/vim-indent-object') @@ -76,7 +67,7 @@ return require('packer').startup(function(use) -- debugging use('mfussenegger/nvim-dap') - use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } + use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } } -- java use('mfussenegger/nvim-jdtls') -- cgit v1.2.3 From 78a876bdb838ae43f21525bd0f24441706bdd5b7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 3 Nov 2023 15:00:36 +0100 Subject: migrated from packer to lazy --- config/essentials/nvim/after/plugin/colorizer.lua | 6 -- .../nvim/after/plugin/colorizer.lua.disabled | 6 ++ config/essentials/nvim/after/plugin/treesitter.lua | 11 --- config/essentials/nvim/lua/user/init.lua | 3 +- config/essentials/nvim/lua/user/lazy.lua | 98 ++++++++++++++++++++++ config/essentials/nvim/lua/user/remap.lua | 4 +- config/essentials/nvim/lua/user/treesitter.lua | 44 ++++++++++ 7 files changed, 152 insertions(+), 20 deletions(-) delete mode 100644 config/essentials/nvim/after/plugin/colorizer.lua create mode 100644 config/essentials/nvim/after/plugin/colorizer.lua.disabled delete mode 100644 config/essentials/nvim/after/plugin/treesitter.lua create mode 100644 config/essentials/nvim/lua/user/lazy.lua create mode 100644 config/essentials/nvim/lua/user/treesitter.lua (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/after/plugin/colorizer.lua b/config/essentials/nvim/after/plugin/colorizer.lua deleted file mode 100644 index 6ca374f..0000000 --- a/config/essentials/nvim/after/plugin/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -require 'colorizer'.setup { - '*'; - html = { - mode = 'foreground'; - } -} diff --git a/config/essentials/nvim/after/plugin/colorizer.lua.disabled b/config/essentials/nvim/after/plugin/colorizer.lua.disabled new file mode 100644 index 0000000..6ca374f --- /dev/null +++ b/config/essentials/nvim/after/plugin/colorizer.lua.disabled @@ -0,0 +1,6 @@ +require 'colorizer'.setup { + '*'; + html = { + mode = 'foreground'; + } +} diff --git a/config/essentials/nvim/after/plugin/treesitter.lua b/config/essentials/nvim/after/plugin/treesitter.lua deleted file mode 100644 index e18368e..0000000 --- a/config/essentials/nvim/after/plugin/treesitter.lua +++ /dev/null @@ -1,11 +0,0 @@ -require'nvim-treesitter.configs'.setup { - ensure_installed = { "c", "lua", "vim", "diff"}, - - sync_install = false, - auto_install = true, - - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - } -} diff --git a/config/essentials/nvim/lua/user/init.lua b/config/essentials/nvim/lua/user/init.lua index 2f29b87..f195e4f 100644 --- a/config/essentials/nvim/lua/user/init.lua +++ b/config/essentials/nvim/lua/user/init.lua @@ -1,5 +1,6 @@ -require("user.packer") +require("user.lazy") require("user.remap") +require("user.treesitter") require("user.set") require("user.cmp") require("user.zk") diff --git a/config/essentials/nvim/lua/user/lazy.lua b/config/essentials/nvim/lua/user/lazy.lua new file mode 100644 index 0000000..5c3148c --- /dev/null +++ b/config/essentials/nvim/lua/user/lazy.lua @@ -0,0 +1,98 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + -- Example using a list of specs with the default options + "folke/which-key.nvim", + + -- telescope + { + 'nvim-telescope/telescope.nvim', + tag = '0.1.4', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + "nvim-telescope/telescope-ui-select.nvim", + "nvim-telescope/telescope-media-files.nvim", + + "nvim-telescope/telescope-symbols.nvim", + "theprimeagen/harpoon", + + -- colors + "shaunsingh/nord.nvim", + { 'uZer/pywal16.nvim', name = 'pywal16' }, + "norcalli/nvim-colorizer.lua", + + { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }, + "nvim-treesitter/playground", + + -- syntax + "sheerun/vim-polyglot", + "theRealCarneiro/hyprland-vim-syntax", + + "mbbill/undotree", + + "tpope/vim-capslock", + "tpope/vim-commentary", + -- "tpope/vim-endwise", + "tpope/vim-fugitive", + "lewis6991/gitsigns.nvim", + "tpope/vim-repeat", + "tpope/vim-surround", + "tpope/vim-vinegar", + "m4xshen/autoclose.nvim", + + "christoomey/vim-tmux-navigator", + + -- utils + "godlygeek/tabular", + "renerocksai/calendar-vim", + "ojroques/vim-oscyank", + "potamides/pantran.nvim", + "alx741/vinfo", + + -- "github/copilot.vim", + -- + { + 'https://gitlab.com/itaranto/plantuml.nvim', + config = function() require('plantuml').setup() end + }, + + -- objects + "michaeljsmith/vim-indent-object", + + -- completion + "neovim/nvim-lspconfig", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp-signature-help", + "alvan/vim-closetag", + + -- debugging + "mfussenegger/nvim-dap", + { "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap" } }, + + -- java + "mfussenegger/nvim-jdtls", + + -- snippets + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + + -- notes + "renerocksai/telekasten.nvim", + +}) diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index fadca21..8a8ad5c 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -73,8 +73,8 @@ vim.keymap.set("n", "s", function () print("sourced.") end, { noremap = true }) --- Packer -vim.keymap.set("n", "P", "PackerSync", { noremap = true }) +-- Lazy +vim.keymap.set("n", "P", "Lazy", { noremap = true }) -- spelling vim.keymap.set("n", "s", "setlocal spell!", { noremap = true }) diff --git a/config/essentials/nvim/lua/user/treesitter.lua b/config/essentials/nvim/lua/user/treesitter.lua new file mode 100644 index 0000000..5b1fc5e --- /dev/null +++ b/config/essentials/nvim/lua/user/treesitter.lua @@ -0,0 +1,44 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + -- List of parsers to ignore installing (or "all") + ignore_install = { "javascript" }, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + indent = { + enable = on + }, + + highlight = { + enable = true, + + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + disable = { "c", "rust" }, + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} -- cgit v1.2.3 From 7e681c9311c858b9c2e0cc87005a4aa2596cf788 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 3 Nov 2023 15:01:11 +0100 Subject: added formatting keybind for tables --- config/essentials/nvim/lua/user/remap.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index 8a8ad5c..0c3d9a6 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -54,9 +54,14 @@ end, { noremap = true }) -- utils vim.keymap.set("i", "r", "r!echo -n $RANDOMkJA", { noremap = true }) + +-- FORMATTING -- ordered list vim.keymap.set("n", "n", "I0. gvg", { noremap = true }) vim.keymap.set("v", "u", "'<,'>s/^[0-9]\\+\\. //", { noremap = true }) +-- table +vim.keymap.set("v", "t", "!column -t -s '|' -o '|'", { noremap = true }) + -- scripts vim.keymap.set("n", "x", "!chmod +x %", { noremap = true, silent = true}) -- replace -- cgit v1.2.3 From e92fe2d61d3e01cbe2351166b8bf809362a5f72d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 6 Nov 2023 10:19:34 +0100 Subject: change back to packer and simplify treesitter config --- config/essentials/nvim/lua/user/init.lua | 2 +- config/essentials/nvim/lua/user/treesitter.lua | 31 ++------------------------ 2 files changed, 3 insertions(+), 30 deletions(-) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/init.lua b/config/essentials/nvim/lua/user/init.lua index f195e4f..972cb67 100644 --- a/config/essentials/nvim/lua/user/init.lua +++ b/config/essentials/nvim/lua/user/init.lua @@ -1,4 +1,4 @@ -require("user.lazy") +require("user.packer") require("user.remap") require("user.treesitter") require("user.set") diff --git a/config/essentials/nvim/lua/user/treesitter.lua b/config/essentials/nvim/lua/user/treesitter.lua index 5b1fc5e..2355215 100644 --- a/config/essentials/nvim/lua/user/treesitter.lua +++ b/config/essentials/nvim/lua/user/treesitter.lua @@ -9,36 +9,9 @@ require'nvim-treesitter.configs'.setup { -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally auto_install = true, - -- List of parsers to ignore installing (or "all") - ignore_install = { "javascript" }, + indent = { enable = on }, - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - indent = { - enable = on - }, + highlight = { enable = true, }, - highlight = { - enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - disable = { "c", "rust" }, - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - disable = function(lang, buf) - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end - end, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, - }, } -- cgit v1.2.3 From 5ad22dddaf672552cba44932f8d33860456907df Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 7 Nov 2023 01:25:21 +0100 Subject: disabled polyglot temporarily --- config/essentials/nvim/lua/user/packer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/packer.lua b/config/essentials/nvim/lua/user/packer.lua index 8091d85..edb763d 100644 --- a/config/essentials/nvim/lua/user/packer.lua +++ b/config/essentials/nvim/lua/user/packer.lua @@ -42,7 +42,7 @@ return require('packer').startup(function(use) use('ojroques/vim-oscyank', { branch = "main" }) use("potamides/pantran.nvim") use('alx741/vinfo') - use('sheerun/vim-polyglot') + -- use('sheerun/vim-polyglot') TODO: fix error conflicting with telekasten -- use('github/copilot.vim') -- use { -- cgit v1.2.3 From b386965b95808a0ad78e6c1dedaefac4693aaad5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:22:50 +0100 Subject: added ideas vault --- config/essentials/nvim/lua/user/zk.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config/essentials/nvim/lua') diff --git a/config/essentials/nvim/lua/user/zk.lua b/config/essentials/nvim/lua/user/zk.lua index 98476ca..3641025 100644 --- a/config/essentials/nvim/lua/user/zk.lua +++ b/config/essentials/nvim/lua/user/zk.lua @@ -41,6 +41,11 @@ require("telekasten").setup({ media_previewer = "telescope-media-files", follow_url_fallback = nil, vaults = { + Ideas = { + home = home .. "/" .. "Ideas", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, Driving = { home = home .. "/" .. "Driving", template_new_note = home .. "/" .. "templates/new_note.md", -- cgit v1.2.3