some stuff

This commit is contained in:
max_richter 2021-11-17 13:55:37 +01:00
parent 293f0a3344
commit f448ef05de
4 changed files with 67 additions and 7 deletions

1
configs/nvim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
plugin

View File

@ -10,6 +10,9 @@ local opt = vim.opt
require ("plugins")
if u.has_plugin("cmp") then
vim.g.did_load_filetypes = 1
-- Global options
o.number = true -- show line number
o.showmatch = true -- show matching brackets
@ -20,7 +23,6 @@ if u.has_plugin("cmp") then
set autoindent
set expandtab
set shiftwidth=2
set smartindent
set softtabstop=2
set tabstop=2
]]
@ -171,6 +173,7 @@ if u.has_plugin("cmp") then
-- Autocompletion Setup
o.completeopt = "menuone,noselect,noinsert"
require "autocomplete"
require "snippets"
-- LSP Config
require "lspinstaller-conf"

View File

@ -6,6 +6,9 @@ return require("packer").startup(function()
-- General Helper Functions
use "nvim-lua/plenary.nvim"
-- Faster Filetype Detection
use "nathom/filetype.nvim"
use "alexghergh/nvim-tmux-navigation"
-- Theming Section
@ -21,6 +24,8 @@ return require("packer").startup(function()
use "karb94/neoscroll.nvim"
use "tpope/vim-fugitive"
use "tpope/vim-surround"
use "editorconfig/editorconfig-vim"
-- Code Navigation
use "dense-analysis/ale"
@ -35,14 +40,20 @@ return require("packer").startup(function()
-- use "lervag/wiki.vim"
-- Syntax / Autocomplete
use "preservim/nerdcommenter"
use "neovim/nvim-lspconfig"
use "williamboman/nvim-lsp-installer"
use "nvim-lua/lsp-status.nvim"
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/cmp-path"
use "weilbith/nvim-code-action-menu" -- Need to find better alternative
use "hrsh7th/cmp-buffer"
use "hrsh7th/cmp-cmdline"
use "L3MON4D3/LuaSnip"
use "saadparwaiz1/cmp_luasnip"
use "rafamadriz/friendly-snippets"
use "tpope/vim-commentary"
use "williamboman/nvim-lsp-installer"
use "nvim-lua/lsp-status.nvim"
use "L3MON4D3/LuaSnip"
use "windwp/nvim-autopairs"
use "neoclide/jsonc.vim"

View File

@ -0,0 +1,45 @@
local ls = require("luasnip")
-- some shorthands...
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local types = require("luasnip.util.types")
-- Every unspecified option will be set to the default.
ls.config.set_config({
history = true,
-- Update more often, :h events for more info.
updateevents = "TextChanged,TextChangedI",
ext_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
},
},
-- treesitter-hl has 100, use something higher (default is 200).
ext_base_prio = 300,
-- minimal increase in priority.
ext_prio_increase = 1,
enable_autosnippets = true,
})
ls.snippets = {
all = {
},
svelte = {
s("slt", {
t('<script lang="ts">'),
i(0),
t('</script>'),
}),
}
}