diff --git a/custom-snippets/package.json b/custom-snippets/package.json new file mode 100644 index 00000000..467961c5 --- /dev/null +++ b/custom-snippets/package.json @@ -0,0 +1,14 @@ +{ + "name": "custom-snippets", + "engines": { + "vscode": "^1.11.0" + }, + "contributes": { + "snippets": [ + { + "language": [ "xml" ], + "path": "./snippets/xml.json" + } + ] + } +} diff --git a/custom-snippets/snippets/xml.json b/custom-snippets/snippets/xml.json new file mode 100644 index 00000000..3da2e55a --- /dev/null +++ b/custom-snippets/snippets/xml.json @@ -0,0 +1,72 @@ +{ + "POM Root": { + "prefix": "pomr", + "body": [ + "", + " 4.0.0", + " ${1:com.example}", + " ${2:my-app}", + " ${3:1.0-SNAPSHOT}", + " ${4:jar}", + " ${5:My App}", + " ${6:My application}", + " ", + " ${7:utf-8}", + " ", + "" + ], + "description": "Maven POM Root" + }, + "POM Parent": { + "prefix": "pomp", + "body": [ + "", + " ${1:com.example}", + " ${2:my-parent}", + " ${3:1.0}", + " ${4:../pom.xml}", + "" + ], + "description": "Maven POM Parent" + }, + "POM Dependency": { + "prefix": "pomd", + "body": [ + "", + " ${1:com.example}", + " ${2:my-dependency}", + " ${3:1.0}", + "" + ], + "description": "Maven POM Dependency" + }, + "POM Plugin": { + "prefix": "poml", + "body": [ + "", + " ${1:org.apache.maven.plugins}", + " ${2:maven-${3:plugin}-plugin}", + " ${4:3.0}", + " ", + " ", + "" + ], + "description": "Maven POM Plugin" + }, + "POM Plugin Execution": { + "prefix": "pomle", + "body": [ + "", + " ${1:default-cli}", + " ${2:compile}", + " ", + " ${3:run}", + " ", + " ", + "" + ], + "description": "Maven POM Plugin Execution" + } +} diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 5f7cb737..7080222b 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -30,6 +30,9 @@ local config = { }, settings = { java = { + format = { + enabled = false, + }, maven = { downloadSources = true, }, diff --git a/init.lua b/init.lua index 623f690c..bde7247f 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -619,6 +619,7 @@ require('lazy').setup({ -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. + java = { 'google-java-format' }, javascript = { 'prettier' }, typescript = { 'prettier' }, go = { 'gofmt', 'goimports', 'golines', 'gofumpt' }, @@ -655,9 +656,12 @@ require('lazy').setup({ -- you can use this plugin to help you. It even has snippets -- for various frameworks/libraries/etc. but you will have to -- set up the ones that are useful for you. - -- 'rafamadriz/friendly-snippets', + 'rafamadriz/friendly-snippets', }, config = function() + require('luasnip.loaders.from_vscode').lazy_load() + require('luasnip.loaders.from_vscode').lazy_load { paths = './custom-snippets/' } + -- See `:help cmp` local cmp = require 'cmp' local luasnip = require 'luasnip' @@ -856,7 +860,6 @@ require('lazy').setup({ vim.keymap.set('n', '', ':NvimTreeFindFileToggle') end, }, - { 'nvim-tree/nvim-web-devicons' }, { 'simrat39/symbols-outline.nvim' }, { 'github/copilot.vim' }, {