Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim
This commit is contained in:
commit
96e1f3f6ed
@ -68,4 +68,3 @@ utils.map('n', '<C-w>', ':bd<CR>')
|
||||
-- <Tab> to navigate the completion menu
|
||||
utils.map('i', '<S-Tab>', 'pumvisible() ? "\\<C-p>" : "\\<Tab>"', { expr = true })
|
||||
utils.map('i', '<Tab>', 'pumvisible() ? "\\<C-n>" : "\\<Tab>"', { expr = true })
|
||||
|
||||
|
@ -53,7 +53,7 @@ return require('packer').startup(function()
|
||||
})
|
||||
use({
|
||||
'sainnhe/gruvbox-material',
|
||||
disable = true
|
||||
disable = true,
|
||||
})
|
||||
use({
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
@ -116,7 +116,7 @@ return require('packer').startup(function()
|
||||
use({ 'ray-x/lsp_signature.nvim' })
|
||||
use({
|
||||
's1n7ax/nvim-terminal',
|
||||
config = get_setup('terminal')
|
||||
config = get_setup('terminal'),
|
||||
})
|
||||
use({
|
||||
'williamboman/nvim-lsp-installer',
|
||||
@ -150,7 +150,7 @@ return require('packer').startup(function()
|
||||
'kyazdani42/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
config = get_setup('neo-tree')
|
||||
config = get_setup('neo-tree'),
|
||||
})
|
||||
use({
|
||||
'mvllow/modes.nvim',
|
||||
@ -162,6 +162,10 @@ return require('packer').startup(function()
|
||||
})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'akinsho/toggleterm.nvim',
|
||||
config = get_setup('toggleterm')
|
||||
})
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
@ -11,7 +11,6 @@ local check_back_space = function()
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- fancy icons and a name of kind
|
||||
@ -87,7 +86,7 @@ cmp.setup({
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
require("clangd_extensions.cmp_scores"),
|
||||
require('clangd_extensions.cmp_scores'),
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
|
@ -1,5 +1,3 @@
|
||||
local utils = require('utils')
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' }
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
@ -127,6 +125,34 @@ lsp_installer.on_server_ready(function(server)
|
||||
return
|
||||
end
|
||||
|
||||
if server.name == 'sumneko_lua' then
|
||||
local lua_rtp = vim.split(package.path, ';')
|
||||
table.insert(lua_rtp, 'lua/?.lua')
|
||||
table.insert(lua_rtp, 'lua/?/init.lua')
|
||||
opts.settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = lua_rtp,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim', 'use' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
|
||||
server:setup(opts)
|
||||
vim.cmd([[ do User LspAttachBuffers ]])
|
||||
@ -152,6 +178,6 @@ require('clangd_extensions').setup({
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim' }
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
||||
},
|
||||
})
|
||||
|
@ -48,6 +48,6 @@ require('neo-tree').setup({
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
utils.map('n', '\\', '<cmd>Neotree reveal<cr>')
|
||||
|
@ -1,6 +1,7 @@
|
||||
local utils = require('utils')
|
||||
require('project_nvim').setup({
|
||||
silent_chdir = true,
|
||||
ignore_lsp = { 'null-ls' },
|
||||
})
|
||||
require('telescope').load_extension('projects')
|
||||
utils.map('n', '<space>p', '<cmd>Telescope projects<cr>')
|
||||
|
32
lua/setup/toggleterm.lua
Normal file
32
lua/setup/toggleterm.lua
Normal file
@ -0,0 +1,32 @@
|
||||
require('toggleterm').setup({})
|
||||
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
-- Disbled for the moment because it is also set for lazygit
|
||||
-- vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
local lazygit = Terminal:new({
|
||||
cmd = 'lazygit',
|
||||
-- dir = vim.fn.getcwd(),
|
||||
hidden = true,
|
||||
direction = 'float',
|
||||
on_open = function(term)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", {noremap = true, silent = true})
|
||||
end,
|
||||
})
|
||||
|
||||
function _lazygit_toggle()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Space>g', '<cmd>lua _lazygit_toggle()<CR>', { noremap = true, silent = true })
|
Loading…
x
Reference in New Issue
Block a user