most usable config

This commit is contained in:
Vladan Popovic 2024-01-04 00:45:21 +01:00
parent d89d00af71
commit 3e2dd9c332
6 changed files with 77 additions and 30 deletions

View file

@ -2,12 +2,53 @@
local utils = require('utils')
--vim.cmd [[set shortmess+=c]]
--utils.opt('o', 'completeopt', 'menuone,noselect')
vim.cmd [[set shortmess+=c]]
utils.opt('o', 'completeopt', 'menuone,noselect')
local cmp = require('cmp')
local cmp_kinds = {
Text = '',
Method = '󰊕 ',
Function = '󰊕 ',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
cmp.setup({
formatting = {
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format('%s %s', cmp_kinds[vim_item.kind], vim_item.kind)
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[LaTeX]",
})[entry.source.name]
return vim_item
end
},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
@ -27,7 +68,6 @@ cmp.setup({
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-n>'] = cmp.mapping.complete(),
['<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.
@ -44,13 +84,13 @@ cmp.setup({
})
-- 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' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
-- }, {
-- { name = 'buffer' },
-- })
--})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {

View file

@ -5,6 +5,16 @@ require('packer').startup(function()
-- Packer can manage itself as an optional plugin
use {'wbthomason/packer.nvim', opt = true }
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
}
}
-- Fuzzy finder
use {
'nvim-telescope/telescope.nvim',
@ -53,7 +63,7 @@ require('packer').startup(function()
}
use { "lewis6991/gitsigns.nvim" }
-- Filesystem in a nvim buffer
-- Filesystem browser
use { 'stevearc/oil.nvim' }
-- Misc

View file

@ -8,16 +8,13 @@ require('nvim-treesitter.configs').setup {
ident = {
enable = true,
},
incremental_selection = {
rainbow = {
enable = true,
keymaps = {
init_selection = "gnn", -- set to `false` to disable one of the mappings
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
extended_mode = false,
max_file_lines = nil,
}
}
vim.api.nvim_set_hl(0, "@variable", { })
vim.api.nvim_set_hl(0, "@parameter", { })
vim.api.nvim_set_hl(0, "@field", { })