mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-09-10 19:56:24 +00:00
Soooo many changes
This commit is contained in:
@@ -5,10 +5,9 @@ local source_mapping = {
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
cmp_tabnine = "[TN]",
|
||||
path = "[Path]",
|
||||
orgmode = "[Org]",
|
||||
luasnip = "[Snippet]",
|
||||
jira = "[Jira]",
|
||||
}
|
||||
|
||||
local has_words_before = function()
|
||||
@@ -58,38 +57,27 @@ cmp.setup({
|
||||
end, { "i", "s" })
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_tabnine' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'nvim_lsp' },
|
||||
}, {
|
||||
{ name = 'buffer'}
|
||||
}),
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
||||
local menu = source_mapping[entry.source.name]
|
||||
if entry.source.name == 'cmp_tabnine' then
|
||||
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
||||
menu = entry.completion_item.data.detail .. ' ' .. menu
|
||||
end
|
||||
vim_item.kind = '?'
|
||||
end
|
||||
vim_item.menu = menu
|
||||
return vim_item
|
||||
end
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
}
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('org', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'orgmode' },
|
||||
{ name = 'cmp_tabnine' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
@@ -105,17 +93,3 @@ cmp.setup.cmdline(':', {
|
||||
mappings = cmp.mapping.preset.cmdline(),
|
||||
})
|
||||
|
||||
-- Setup tabnine
|
||||
local tabnine = require('cmp_tabnine.config')
|
||||
tabnine:setup({
|
||||
max_lines = 1000;
|
||||
max_num_results = 20;
|
||||
sort = true;
|
||||
run_on_every_keystroke = true;
|
||||
snippet_placeholder = '..';
|
||||
ignored_file_types = { -- default is not to ignore
|
||||
-- uncomment to ignore in lua:
|
||||
lua = true
|
||||
};
|
||||
})
|
||||
|
||||
|
@@ -1,3 +1,11 @@
|
||||
|
||||
local function formatted_status()
|
||||
local status = require'lsp-status'.status()
|
||||
status = string.gsub(status, "%%", "%%%%")
|
||||
return status
|
||||
end
|
||||
|
||||
|
||||
require 'lualine'.setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
@@ -10,7 +18,12 @@ require 'lualine'.setup {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { "require'lsp-status'.status()", 'filetype' },
|
||||
lualine_x = {
|
||||
{"require'lsp-status'.status()", fmt = function (str)
|
||||
return string.gsub(str, "%%", "%%%%")
|
||||
end},
|
||||
'filetype'
|
||||
},
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
|
@@ -4,4 +4,3 @@ luasnip.config.set_config {
|
||||
updateevents = "TextChanged,TextChangedI"
|
||||
}
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
@@ -9,6 +9,4 @@ neogit.setup {
|
||||
|
||||
nnoremap("<leader>gs", function()
|
||||
neogit.open({ })
|
||||
end);
|
||||
|
||||
nnoremap("<leader>ga", "<cmd>!git fetch --all<CR>");
|
||||
end)
|
||||
|
@@ -30,6 +30,7 @@ end
|
||||
|
||||
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
||||
|
||||
vim.opt.runtimepath:append("~/code/jira.nvim")
|
||||
return require("packer").startup({
|
||||
function(use)
|
||||
-- Packer can manage itself as an optional plugin
|
||||
@@ -113,7 +114,8 @@ return require("packer").startup({
|
||||
{ 'hrsh7th/cmp-nvim-lua', after = 'nvim-cmp' },
|
||||
{ 'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-cmdline', after = 'nvim-cmp', event = 'CmdlineEnter' },
|
||||
{'tzachar/cmp-tabnine', run = './install.sh', after = 'nvim-cmp' }
|
||||
{'tzachar/cmp-tabnine', run = './install.sh', after = 'nvim-cmp' },
|
||||
{'petertriho/cmp-git', after = 'nvim-cmp'},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +131,8 @@ return require("packer").startup({
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
use { 'numToStr/FTerm.nvim' }
|
||||
|
||||
-- Telescope fuzzy find files/grep
|
||||
use {'nvim-lua/popup.nvim'}
|
||||
use {'nvim-lua/plenary.nvim'}
|
||||
|
Reference in New Issue
Block a user