remove obsolete config and autoformat

This commit is contained in:
Vladan Popovic 2024-03-20 12:49:43 +01:00
parent 8a348282a4
commit a35b743b62
11 changed files with 165 additions and 160 deletions

View File

@ -5,6 +5,5 @@ vim.g.mapleader = ' '
require('settings')
require('plugins')
require('lsp')
require('filetypes')
require('theme')
require('keymappings')

View File

@ -1,4 +0,0 @@
vim.cmd([[
autocmd BufRead,BufNewFile *.bu set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
]])

View File

@ -13,6 +13,9 @@ local on_attach = function(client, bufnr)
utils.map("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
utils.map("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
-- use vim's default coloring
client.server_capabilities.semanticTokensProvider = nil
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {

View File

@ -69,24 +69,26 @@ cmp.setup({
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-x><C-o>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
-- Accept currently selected item.
-- Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
--cmp.setup.filetype('gitcommit', {
-- sources = cmp.config.sources({
-- { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
-- }, {
-- { name = 'buffer' },
-- })
--})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' },
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {

View File

@ -1,7 +1,6 @@
require('plugins.packer_setup')
require('packer').startup(function()
-- Packer can manage itself as an optional plugin
use { 'wbthomason/packer.nvim', opt = true }
@ -82,7 +81,6 @@ require('packer').startup(function()
-- Misc
use { 'jbyuki/venn.nvim' } -- ascii diagrams
use { 'hashivim/vim-terraform' }
end)
require('plugins.cmp')

View File

@ -17,5 +17,6 @@ function _G.Toggle_venn()
vim.b.venn_enabled = nil
end
end
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true })

View File

@ -33,3 +33,9 @@ vim.opt.undofile = true
-- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true
vim.opt.secure = true
-- unknown filetypes mappings
vim.cmd([[
autocmd BufRead,BufNewFile *.bu set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
]])