From 27e1adad339e1623c236b5027ec3835f4da6409f Mon Sep 17 00:00:00 2001 From: Kenneth Date: Sat, 25 May 2024 14:11:57 +0100 Subject: [PATCH] goneovim integration --- goneovim.toml | 3 ++ nvim/init.lua | 38 ++++++++++++++++++++++- nvim/lazy-lock.json | 2 +- nvim/macmap.vim | 75 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 goneovim.toml create mode 100644 nvim/macmap.vim diff --git a/goneovim.toml b/goneovim.toml new file mode 100644 index 0000000..7265ff7 --- /dev/null +++ b/goneovim.toml @@ -0,0 +1,3 @@ +[Editor] +FontFamily = "CommitMono Nerd Font" +FontSize = 14 diff --git a/nvim/init.lua b/nvim/init.lua index d1cfbb6..a6da64d 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -95,6 +95,10 @@ function setup_plugins() -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, + + autotag = { + enable = true, + }, }) require("auto-dark-mode").setup({ @@ -257,6 +261,7 @@ function setup_plugins() extensions = {}, }) + local util = require("formatter.util") require("formatter").setup({ filetype = { javascript = { @@ -274,11 +279,40 @@ function setup_plugins() json = { require("formatter.filetypes.json").biome, }, + css = { + require("formatter.filetypes.css").prettier, + }, + astro = { + function() + return { + exe = "prettier", + args = { + "--stdin-filepath", + util.escape_path(util.get_current_buffer_file_path()), + "--parser", + "astro", + }, + stdin = true, + try_node_modules = true, + } + end, + }, lua = { require("formatter.filetypes.lua").stylua }, cpp = { require("formatter.filetypes.cpp").clangformat }, dart = { require("formatter.filetypes.dart").dartformat }, python = { require("formatter.filetypes.python").black }, go = { require("formatter.filetypes.go").goimports }, + sql = { + function() + return { + exe = "sqlfmt", + args = { + "-", + }, + stdin = true, + } + end, + }, }, }) @@ -442,7 +476,6 @@ function config_vim() end PLUGINS = { - { "EdenEast/nightfox.nvim" }, { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, { "shortcuts/no-neck-pain.nvim" }, { "nvim-tree/nvim-web-devicons" }, @@ -506,9 +539,12 @@ PLUGINS = { event = "InsertEnter", config = true, }, + { "windwp/nvim-ts-autotag" }, } init_lazy_nvim() setup_plugins() define_keymaps() config_vim() + +vim.cmd("source ~/dotfiles/nvim/macmap.vim") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index b9ac1d1..54f44a0 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -14,13 +14,13 @@ "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "nightfox.nvim": { "branch": "main", "commit": "df75a6a94910ae47854341d6b5a6fd483192c0eb" }, "no-neck-pain.nvim": { "branch": "main", "commit": "34625be12649666b7ccb08761087cc97bb788552" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, "nvim-tree.lua": { "branch": "master", "commit": "347e1eb35264677f66a79466bb5e3d111968e12c" }, "nvim-treesitter": { "branch": "master", "commit": "cbf9090a4c715fa9eb38be71062bf19194b45bd2" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, diff --git a/nvim/macmap.vim b/nvim/macmap.vim new file mode 100644 index 0000000..dc76f15 --- /dev/null +++ b/nvim/macmap.vim @@ -0,0 +1,75 @@ +" System gvimrc file for Mac OS X +" Author: Benji Fisher +" Last Change: Thu Mar 09 09:00 AM 2006 EST +" +" Define Mac-standard keyboard shortcuts. + +" We don't change 'cpoptions' here, because it would not be set properly when +" a .vimrc file is found later. Thus don't use line continuation and use +" in mappings. + +nnoremap :confirm enew +vmap gv +imap +cmap +omap + +nnoremap :browse confirm e +vmap gv +imap +cmap +omap + +nnoremap :if winheight(2) < 0 confirm enew else confirm close endif +vmap gv +imap +cmap +omap + +nnoremap :if expand("%") == ""browse confirm w elseconfirm wendif +vmap gv +imap +cmap +omap + +nnoremap :browse confirm saveas +vmap gv +imap +cmap +omap + +" From the Edit menu of SimpleText: +nnoremap u +vmap gv +imap +cmap +omap + +vnoremap "+x + +vnoremap "+y + +cnoremap + +nnoremap "+gP +cnoremap + +execute 'vnoremap