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('settings')
require('plugins') require('plugins')
require('lsp') require('lsp')
require('filetypes')
require('theme') require('theme')
require('keymappings') 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>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
utils.map("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_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 if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {

View file

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

View file

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

View file

@ -17,5 +17,6 @@ function _G.Toggle_venn()
vim.b.venn_enabled = nil vim.b.venn_enabled = nil
end end
end end
-- toggle keymappings for venn using <leader>v -- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true }) 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 -- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true vim.opt.exrc = true
vim.opt.secure = true vim.opt.secure = true
-- unknown filetypes mappings
vim.cmd([[
autocmd BufRead,BufNewFile *.bu set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
]])