From b56b0d3ca316395a903ed1c7a040bda0ae321c36 Mon Sep 17 00:00:00 2001 From: claw0ry Date: Wed, 11 Dec 2024 13:58:21 +0100 Subject: fresh start --- nvim/after/ftplugin/javascript.lua | 4 + nvim/after/ftplugin/markdown.lua | 2 + nvim/after/ftplugin/terraform.lua | 4 + nvim/init.lua | 660 +++++++++++++++++++++++++++++++++++++ nvim/snippets/css.json | 10 + nvim/snippets/go.json | 20 ++ nvim/snippets/javascript.json | 46 +++ nvim/snippets/package.json | 42 +++ nvim/snippets/powershell.json | 20 ++ nvim/snippets/python.json | 20 ++ nvim/snippets/terraform.json | 20 ++ 11 files changed, 848 insertions(+) create mode 100644 nvim/after/ftplugin/javascript.lua create mode 100644 nvim/after/ftplugin/markdown.lua create mode 100644 nvim/after/ftplugin/terraform.lua create mode 100644 nvim/init.lua create mode 100644 nvim/snippets/css.json create mode 100644 nvim/snippets/go.json create mode 100644 nvim/snippets/javascript.json create mode 100644 nvim/snippets/package.json create mode 100644 nvim/snippets/powershell.json create mode 100644 nvim/snippets/python.json create mode 100644 nvim/snippets/terraform.json (limited to 'nvim') diff --git a/nvim/after/ftplugin/javascript.lua b/nvim/after/ftplugin/javascript.lua new file mode 100644 index 0000000..68676e5 --- /dev/null +++ b/nvim/after/ftplugin/javascript.lua @@ -0,0 +1,4 @@ +vim.bo.tabstop = 4 +vim.bo.shiftwidth = 4 +vim.bo.expandtab = true +vim.bo.softtabstop = 4 diff --git a/nvim/after/ftplugin/markdown.lua b/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..7b75a27 --- /dev/null +++ b/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,2 @@ +vim.opt.wrap = true +vim.opt.linebreak = true diff --git a/nvim/after/ftplugin/terraform.lua b/nvim/after/ftplugin/terraform.lua new file mode 100644 index 0000000..9edb208 --- /dev/null +++ b/nvim/after/ftplugin/terraform.lua @@ -0,0 +1,4 @@ +vim.bo.tabstop = 2 +vim.bo.shiftwidth = 2 +vim.bo.expandtab = true +vim.bo.softtabstop = 2 diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..30bd8e6 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,660 @@ +-- ----------------------------- +-- --- GLOBAL CONFIGURATIONS --- +-- ----------------------------- + +-- use space as key +vim.g.mapleader = " " + +-- vim.opt.correct lang to make copy to clipboard utf-8 +vim.cmd [[ + lang en_US.UTF-8 + syntax on + filetype plugin indent on +]] + +vim.opt.encoding = 'utf-8' +vim.o.termguicolors = true +vim.opt.regexpengine = 1 + +-- relative numbers +vim.opt.nu = true +vim.opt.relativenumber = true + +-- indent with 4 spaces +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.smartindent = true +vim.opt.autoindent = true + +-- hightlight active line +vim.opt.cursorline = true + +-- searching +vim.opt.incsearch = true +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.hlsearch = false + +-- treat dash separated words as a word text-object +vim.opt.iskeyword:append('-') + +-- integrate vim clipboard with system clipboard +vim.opt.clipboard:append('unnamedplus') + +-- display title of current file in terminal title bar +vim.opt.title = true + +-- allow hidden buffers +vim.opt.hidden = true + +-- disable beeping +vim.opt.errorbells = false + +-- dont wrap long lines +vim.opt.wrap = false + +-- dont use swapfiles +vim.opt.swapfile = false + +-- disable backups +vim.opt.backup = false +vim.opt.writebackup = false + +-- start scrolling when 8 lines left +vim.opt.scrolloff = 8 + +-- always show the sign column +vim.opt.signcolumn = 'yes' + +-- new splits are added to bottom or right +vim.opt.splitbelow = true +vim.opt.splitright = true + +-- avoid delays when typing +vim.opt.updatetime = 50 + +-- set py version +vim.opt.pyx = 3 + +-- display colorcolumn at 115 characters +vim.opt.colorcolumn = '115' + +-- color column color +vim.cmd('highlight ColorColumn ctermbg=darkgray') + +-- enabled mouse support +vim.opt.mouse = 'a' + +-- ??? +vim.opt.completeopt = "menu,menuone,noselect" + +-- show whitespaces characters +vim.opt.listchars = { eol = "↲", tab = "> ", trail = "~", precedes = "<", space = " ", nbsp = "×" } +vim.opt.list = true + +-- disable unused modules +vim.g.loaded_perl_provider = 0 + +-- recognize terraform filetypes +vim.cmd([[autocmd BufRead,BufNewFile *.tf,*.tfvars set filetype=terraform]]) + +-- ----------------------------- +-- --- PLUGINS (PACKER) --- +-- ----------------------------- + +-- Only required if you have packer configured as `opt` +vim.cmd [[packadd packer.nvim]] + +require('packer').startup(function(use) + -- packer can manage itself + use 'wbthomason/packer.nvim' + + -- themes + use "blazkowolf/gruber-darker.nvim" + + + -- lsp + use 'neovim/nvim-lspconfig' + use 'hrsh7th/cmp-nvim-lsp' + use 'hrsh7th/cmp-buffer' + use 'hrsh7th/nvim-cmp' + use 'hrsh7th/cmp-path' + use 'L3MON4D3/LuaSnip' + use 'saadparwaiz1/cmp_luasnip' + use "rafamadriz/friendly-snippets" + + -- language specifics + use 'carlsmedstad/vim-bicep' + + -- telescope + use 'nvim-lua/plenary.nvim' + use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } + use 'nvim-telescope/telescope.nvim' + + -- fzf + use { 'junegunn/fzf', run = function() vim.fn['fzf#install']() end } + use 'junegunn/fzf.vim' + + -- treesitter + use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + use 'williamboman/mason.nvim' + + -- markdown + use({ + "iamcco/markdown-preview.nvim", + run = "cd app && npm install", + setup = function() vim.g.mkdp_filetypes = { "markdown" } end, + ft = { "markdown" }, + }) + + -- other + use 'airblade/vim-gitgutter' + use 'tpope/vim-commentary' + use 'tpope/vim-surround' + use { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } } + use { 'folke/todo-comments.nvim', requires = 'nvim-lua/plenary.nvim' } + use 'akinsho/toggleterm.nvim' +end) + +-- ----------------------------- +-- --- TELESCOPE --- +-- ----------------------------- + +require('telescope').setup({ + defaults = { + layout_strategy = 'vertical', + layout_config = { + height = 0.95, + }, + }, + pickers = { + find_files = { + disable_devicons = true + }, + live_grep = { + disable_devicons = true + }, + buffers = { + disable_devicons = true + }, + help_tags = { + disable_devicons = true + }, + diagnostics = { + disable_devicons = true + }, + git_commits = { + disable_devicons = true + }, + }, +}) + +-- ----------------------------- +-- --- VIM-COMMENTARY --- +-- ----------------------------- +vim.cmd [[ + autocmd FileType terraform setlocal commentstring=#\ %s +]] + +-- ----------------------------- +-- --- TREESITTER --- +-- ----------------------------- + +require('nvim-treesitter.configs').setup({ + ensure_installed = { + "lua", + "terraform", + "go", + "javascript", + "html", + "css", + "c", + "lua", + "vim", + "vimdoc", + "query", + }, + sync_install = false, + auto_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + } +}) + + +-- ----------------------------- +-- --- LUALINE --- +-- ----------------------------- + +require('lualine').setup({ + options = { + theme = 'auto', + icons_enabled = true, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff" }, + lualine_c = { { "filename", path = 1, } }, + lualine_x = { "encoding", "filetype" }, + lualine_y = { "location", "progress" }, + lualine_z = { { + "diagnostics", + sources = { "nvim_workspace_diagnostic", "nvim_lsp" }, + sections = { "error", "warn" }, + diagnostics_color = { + -- Same values as the general color option can be used here. + error = 'red', -- Changes diagnostics' error color. + warn = 'orange', -- Changes diagnostics' warn color. + }, + symbols = { error = "E", warn = "W" }, + colored = true, + update_in_insert = false, + always_visible = true, + } }, + } +}) + +-- ----------------------------- +-- --- MASON --- +-- ----------------------------- + +require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } +}) + +-- ----------------------------- +-- --- LUASNIP --- +-- ----------------------------- +-- load snippets from path/of/your/nvim/config/snippets +require("luasnip.loaders.from_vscode").load({ paths = { "./snippets" } }) + +-- ----------------------------- +-- --- AUTOCOMPLETE (CMP) --- +-- ----------------------------- +local has_words_before = function() + unpack = unpack or table.unpack + 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 luasnip = require("luasnip") +local cmp = require("cmp") +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + completion = cmp.config.window.bordered(), + }, + mapping = { + [''] = cmp.mapping.complete(), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [''] = 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" }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.confirm() + else + fallback() + end + end, { "i", "s" }) + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip', option = { show_autosnippets = true } }, -- For luasnip users. + }, { + { name = 'buffer' }, + }) +}) + +-- ----------------------------- +-- --- LSP --- +-- ----------------------------- + +local capabilities = vim.tbl_deep_extend( + "force", + require("lspconfig").util.default_config.capabilities, + require('cmp_nvim_lsp').default_capabilities() +) + +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + + -- Mappings. + local bufopts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set('n', 'gd', "Telescope lsp_definitions", bufopts) + vim.keymap.set('n', 'gr', "Telescope lsp_references", bufopts) + vim.keymap.set('n', 'gi', "Telescope lsp_implementations", bufopts) + vim.keymap.set('n', 'D', "Telescope lsp_type_definitions", bufopts) + vim.keymap.set('n', 'd', "Telescope diagnostics", bufopts) + + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set('n', 'dj', vim.diagnostic.goto_next, bufopts) + vim.keymap.set('n', 'dk', vim.diagnostic.goto_prev, bufopts) + + vim.cmd([[ + augroup formatting + autocmd! * + autocmd BufWritePre lua vim.lsp.buf.format() + augroup END + ]]) +end + +require("lspconfig")["pyright"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +require("lspconfig")["lua_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + Lua = { + diagnostics = { + globals = { + 'vim', + } + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + }, + } +}) + +require("lspconfig")["gopls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + gopls = { + gofumpt = true, + } + } +}) + +require("lspconfig")["terraformls"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + + -- Mappings. + local bufopts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set('n', 'gr', "Telescope lsp_references", bufopts) + vim.keymap.set('n', 'gi', "Telescope lsp_implementations", bufopts) + vim.keymap.set('n', 'gd', "Telescope lsp_definitions", bufopts) + vim.keymap.set('n', 'D', "Telescope lsp_type_definitions", bufopts) + vim.keymap.set("n", "v", "vsplit | Telescope lsp_definitions") -- open definitions in vertical split + vim.keymap.set('n', 'd', "Telescope diagnostics", bufopts) + + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set('n', 'dj', vim.diagnostic.goto_next, bufopts) + vim.keymap.set('n', 'dk', vim.diagnostic.goto_prev, bufopts) + end +}) + +require('lspconfig')['powershell_es'].setup({ + bundle_path = vim.env.HOME .. '/.config/PowerShellEditorServices', + capabilities = capabilities, + on_attach = on_attach, + init_options = { + enableProfileLoading = false, + }, + settings = { + ["powershell"] = { + codeFolding = { + enable = false, + }, + codeFormatting = { + newLineAfterCloseBrace = false, + pipelineIndentationStyle = "IncreaseIndentationForFirstPipeline", + trimWhitespaceAroundPipe = true, + useCorrectCasing = true, + whitespaceBetweenParameters = true, + openBraceOnSameLine = true, + alignPropertyValuePairs = true, + ignoreOneLineBlock = true, + } + } + } +}) + +local lsputil = require('lspconfig/util') +require('lspconfig')['bicep'].setup({ + capabilities = capabilities, + on_attach = on_attach, + cmd = { "dotnet", "/usr/local/bin/bicep-langserver/Bicep.LangServer.dll" }, + filetypes = { "bicep" }, + root_dir = lsputil.root_pattern(".git"), +}) + +require("lspconfig")["tsserver"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +require("lspconfig")["html"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +require("lspconfig")["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +require("lspconfig")["jsonls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- ----------------------------- +-- --- TOGGLETERM --- +-- ----------------------------- + +require('toggleterm').setup({ + size = 20, + open_mapping = [[]], + hide_numbers = true, + direction = 'horizontal', + close_on_exit = false, +}) + +-- keybindings +-- sends the whole line where you are standing with your cursor +local trim_spaces = true + +vim.keymap.set("v", "s", function() + require("toggleterm").send_lines_to_terminal("single_line", trim_spaces, { args = vim.v.count }) +end) + +-- Replace with these for the other two options +-- require("toggleterm").send_lines_to_terminal("visual_line", trim_spaces, { args = vim.v.count }) +-- require("toggleterm").send_lines_to_terminal("visual_selection", trim_spaces, { args = vim.v.count }) + +function _G.set_terminal_keymaps() + local opts = { buffer = 0 } + vim.keymap.set('t', '', [[]], opts) + vim.keymap.set('t', 'jk', [[]], opts) + vim.keymap.set('t', '', [[wincmd h]], opts) + vim.keymap.set('t', '', [[wincmd j]], opts) + vim.keymap.set('t', '', [[wincmd k]], opts) + vim.keymap.set('t', '', [[wincmd l]], opts) + vim.keymap.set('t', '', [[]], opts) +end + +vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') + +-- ----------------------------- +-- --- KEYMAPPING --- +-- ----------------------------- + +vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "", "", { noremap = false }) + +-- copy the whole file and stay where you are +vim.keymap.set("n", "yy", "ggVGy") + +-- move visual line(s) up and down +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- move lines up/down +vim.keymap.set("n", "", "m-2") +vim.keymap.set("n", "", "m+1") +vim.keymap.set("i", "", "m-2") +vim.keymap.set("i", "", "m+1") + +-- keeps search in the middle +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- keeps half page up and down in the middle +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") + +-- deletes highlighted word/line into void and keeps the pasted value +-- in default register so you can paste many times +vim.keymap.set("x", "p", "\"_dP") + +-- delete to void +vim.keymap.set("n", "d", "\"_d") +vim.keymap.set("v", "d", "\"_d") + +-- search and replace +vim.keymap.set("n", "s", ":%s/\\<\\>//gI") + +-- switching between windows +vim.keymap.set("n", "h", "wincmd h") +vim.keymap.set("n", "j", "wincmd j") +vim.keymap.set("n", "k", "wincmd k") +vim.keymap.set("n", "l", "wincmd l") + +-- resizing +vim.keymap.set("n", "", "vertical resize -4") +vim.keymap.set("n", "", "vertical resize +4") +vim.keymap.set("n", "", "resize +4") +vim.keymap.set("n", "", "resize -4") + +-- telescope +local ts_builtin = require('telescope.builtin') +vim.keymap.set("n", "", ts_builtin.find_files) +vim.keymap.set("n", "ff", function() ts_builtin.find_files({ no_ignore = true, hidden = true }) end) +vim.keymap.set("n", "fg", + function() + ts_builtin.live_grep({ + additional_args = { + '--hidden', + '--glob=!**/.git/*', + "--glob=!**/.idea/*", + "--glob=!**/.vscode/*", + "--glob=!**/build/*", + "--glob=!**/dist/*", + "--glob=!**/yarn.lock", + "--glob=!**/package-lock.json", + } + }) + end) +vim.keymap.set("n", "b", ts_builtin.buffers) +vim.keymap.set("n", "fh", ts_builtin.help_tags) +vim.keymap.set("n", "fd", ts_builtin.diagnostics) +vim.keymap.set("n", "gc", ts_builtin.git_commits) +vim.keymap.set("n", "qf", ts_builtin.quickfix) +vim.keymap.set("n", "gs", ts_builtin.git_status) + +-- todo-comments +vim.keymap.set("n", "ft", "TodoTelescope keywords=TODO,FIXME") + +-- toggle diagnostics +vim.keymap.set("n", "", function() + local current_value = vim.diagnostic.config().virtual_text + if current_value then + vim.diagnostic.config({ virtual_text = false, signs = false }) + else + vim.diagnostic.config({ virtual_text = true, signs = true }) + end +end) + +-- ----------------------------- +-- --- THEME SETTINGS --- +-- ----------------------------- +vim.cmd.colorscheme("gruber-darker") + +-- ----------------------------- +-- --- TODO-COMMENTS --- +-- ----------------------------- + +require("todo-comments").setup({ + signs = false, + gui_style = { + fg = "ITALIC", + }, + merge_keywords = false, + highlight = { + multiline = true, + before = "bg", + keyword = "wide", + after = "fg", + comments_only = true, + }, + keywords = { + TODO = { color = "warning" } + }, +}) + +-- ----------------------------- +-- --- COMMANDS --- +-- ----------------------------- + +-- you might have to force true color when using regular vim inside tmux as the +-- colorscheme can appear to be grayscale with "termguicolors" option enabled. +vim.cmd [[ +if !has('gui_running') && &term =~ '^\%(screen\|tmux\)' + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" +endif +]] + +-- reload file if changes from outside +vim.cmd("au FocusGained,BufEnter * :checktime") + +-- avoid human error +vim.cmd("command! W w") diff --git a/nvim/snippets/css.json b/nvim/snippets/css.json new file mode 100644 index 0000000..22106f4 --- /dev/null +++ b/nvim/snippets/css.json @@ -0,0 +1,10 @@ +{ + "snip1": { + "prefix": "scmt", + "body": [ + "/* -----------------------------------------------------------------------------", + " * - $1 -", + " * -----------------------------------------------------------------------------*/$2" + ] + } +} diff --git a/nvim/snippets/go.json b/nvim/snippets/go.json new file mode 100644 index 0000000..1b71808 --- /dev/null +++ b/nvim/snippets/go.json @@ -0,0 +1,20 @@ +{ + "snip1": { + "prefix": "cmt", + "body": [ + "//-------------------------------------------------------------------------------", + "// $1", + "//", + "// $2", + "//-------------------------------------------------------------------------------" + ] + }, + "snip2": { + "prefix": "scmt", + "body": [ + "// -----------------------------------------------------------------------------", + "// - $1 -", + "// -----------------------------------------------------------------------------$2" + ] + } +} diff --git a/nvim/snippets/javascript.json b/nvim/snippets/javascript.json new file mode 100644 index 0000000..c667981 --- /dev/null +++ b/nvim/snippets/javascript.json @@ -0,0 +1,46 @@ +{ + "snip1": { + "prefix": "cmt", + "body": [ + "//-------------------------------------------------------------------------------", + "// $1", + "//", + "// $2", + "//-------------------------------------------------------------------------------" + ] + }, + "snip2": { + "prefix": "scmt", + "body": [ + "// -----------------------------------------------------------------------------", + "// - $1 -", + "// -----------------------------------------------------------------------------$2" + ] + }, + "gliderecord": { + "prefix": "jgr", + "body": [ + "var $1 = new GlideRecord('$2');", + "$1.addQuery('$3', $4);", + "$1.query();", + "", + "while ($1.next()) {", + "\t$5", + "}" + ] + }, + "docfunc": { + "prefix": "func", + "body": [ + "/**", + " * $1", + " *", + " * @parm {$2} $3 - $4", + " * @return {$5} - $6", + " */", + "function $7($8) {", + "\t$9", + "}" + ] + } +} diff --git a/nvim/snippets/package.json b/nvim/snippets/package.json new file mode 100644 index 0000000..d6f2cb4 --- /dev/null +++ b/nvim/snippets/package.json @@ -0,0 +1,42 @@ +{ + "name": "example-snippets", + "contributes": { + "snippets": [ + { + "language": "all", + "path": "./all.json" + }, + { + "language": "go", + "path": "./go.json" + }, + { + "language": "javascript", + "path": "./javascript.json" + }, + { + "language": "css", + "path": "./css.json" + }, + { + "language": [ + "ps1", + "powershell" + ], + "path": "./powershell.json" + }, + { + "language": "python", + "path": "./python.json" + }, + { + "language": [ + "terraform", + "hcl", + "tf" + ], + "path": "./terraform.json" + } + ] + } +} diff --git a/nvim/snippets/powershell.json b/nvim/snippets/powershell.json new file mode 100644 index 0000000..1f47642 --- /dev/null +++ b/nvim/snippets/powershell.json @@ -0,0 +1,20 @@ +{ + "snip1": { + "prefix": "cmt", + "body": [ + "#-------------------------------------------------------------------------------", + "# $1", + "#", + "# $2", + "#-------------------------------------------------------------------------------" + ] + }, + "snip2": { + "prefix": "scmt", + "body": [ + "# -----------------------------------------------------------------------------", + "# - $1 -", + "# -----------------------------------------------------------------------------$2" + ] + } +} diff --git a/nvim/snippets/python.json b/nvim/snippets/python.json new file mode 100644 index 0000000..1f47642 --- /dev/null +++ b/nvim/snippets/python.json @@ -0,0 +1,20 @@ +{ + "snip1": { + "prefix": "cmt", + "body": [ + "#-------------------------------------------------------------------------------", + "# $1", + "#", + "# $2", + "#-------------------------------------------------------------------------------" + ] + }, + "snip2": { + "prefix": "scmt", + "body": [ + "# -----------------------------------------------------------------------------", + "# - $1 -", + "# -----------------------------------------------------------------------------$2" + ] + } +} diff --git a/nvim/snippets/terraform.json b/nvim/snippets/terraform.json new file mode 100644 index 0000000..1f47642 --- /dev/null +++ b/nvim/snippets/terraform.json @@ -0,0 +1,20 @@ +{ + "snip1": { + "prefix": "cmt", + "body": [ + "#-------------------------------------------------------------------------------", + "# $1", + "#", + "# $2", + "#-------------------------------------------------------------------------------" + ] + }, + "snip2": { + "prefix": "scmt", + "body": [ + "# -----------------------------------------------------------------------------", + "# - $1 -", + "# -----------------------------------------------------------------------------$2" + ] + } +} -- cgit v1.2.3