Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim
This commit is contained in:
commit
76249b2a8a
@ -25,10 +25,14 @@ vim.keymap.set({ 'n', 'x' }, '<End>', 'g<End>', opts)
|
||||
vim.keymap.set('x', '<', '<gv')
|
||||
vim.keymap.set('x', '>', '>gv')
|
||||
|
||||
local function hlWord()
|
||||
local current_word = vim.call('expand','<cword>')
|
||||
vim.fn.setreg('/', "\\<" .. current_word .. "\\>")
|
||||
vim.opt.hlsearch = true
|
||||
end
|
||||
-- Highlight word under cursor
|
||||
vim.keymap.set('n', "'", ':let @/=\'\\<<C-R>=expand("<cword>")<CR>\\>\'<CR>:set hls<CR>', { noremap = true, silent = true })
|
||||
-- vim.keymap.set('v', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>")
|
||||
vim.keymap.set('x', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>", { noremap = true, silent = true })
|
||||
vim.keymap.set('n', "'", hlWord, { noremap = true, silent = true })
|
||||
vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true })
|
||||
|
||||
-- Close Buffer
|
||||
vim.keymap.set('n', '<C-w>', ':bd<CR>')
|
||||
|
@ -105,12 +105,19 @@ return require('packer').startup(function()
|
||||
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
||||
{ 'p00f/clangd_extensions.nvim' },
|
||||
},
|
||||
as = 'cmp',
|
||||
config = get_setup('cmp'),
|
||||
})
|
||||
use({ 'L3MON4D3/LuaSnip', config = get_setup('luasnip') })
|
||||
use({ 'rafamadriz/friendly-snippets' })
|
||||
use({ 'onsails/lspkind-nvim' })
|
||||
use({ 'Shatur/neovim-cmake', requires = { 'mfussenegger/nvim-dap' }, config = get_setup('cmake') })
|
||||
use({ 'Shatur/neovim-cmake',
|
||||
requires = { 'mfussenegger/nvim-dap' },
|
||||
config = get_setup('cmake'),
|
||||
opt = true,
|
||||
module = 'cmake',
|
||||
cmd = 'CMake'
|
||||
})
|
||||
use({
|
||||
'hoob3rt/lualine.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||
@ -198,7 +205,14 @@ return require('packer').startup(function()
|
||||
}
|
||||
use {
|
||||
'stevearc/aerial.nvim',
|
||||
config = get_setup('aerial')
|
||||
requires = {
|
||||
'nvim-telescope/telescope.nvim'
|
||||
},
|
||||
config = get_setup('aerial'),
|
||||
opt = true,
|
||||
keys = { '<leader>s', '<space>s' },
|
||||
module = 'aerial',
|
||||
cmd = 'AerialToggle'
|
||||
}
|
||||
use {
|
||||
'm-demare/hlargs.nvim',
|
||||
@ -214,17 +228,36 @@ return require('packer').startup(function()
|
||||
'mfussenegger/nvim-dap',
|
||||
requires = {
|
||||
'mfussenegger/nvim-dap-python',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
'nvim-telescope/telescope-dap.nvim',
|
||||
'rcarriga/cmp-dap',
|
||||
'rcarriga/nvim-dap-ui'
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
module = 'nvim-dap-virtual-text'
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope-dap.nvim',
|
||||
module = 'telescope._extensions.dap',
|
||||
requires = 'telescope.nvim',
|
||||
},
|
||||
{
|
||||
'rcarriga/cmp-dap',
|
||||
requires = 'cmp'
|
||||
},
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
module = 'dapui'
|
||||
},
|
||||
},
|
||||
config = get_setup('my_dap')
|
||||
keys = { '<F5>', '<F9>' },
|
||||
module = 'dap',
|
||||
config = get_setup('my_dap'),
|
||||
opt = true,
|
||||
}
|
||||
use {
|
||||
'sindrets/diffview.nvim',
|
||||
requires = 'nvim-lua/plenary.nvim',
|
||||
config = get_setup('my_diffview')
|
||||
config = get_setup('my_diffview'),
|
||||
opt = true,
|
||||
cmd = 'DiffviewOpen',
|
||||
module = { 'diffview', 'diffview.actions' }
|
||||
}
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
|
@ -4,3 +4,4 @@ require('aerial').setup({
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
})
|
||||
require('telescope').load_extension('aerial')
|
||||
|
@ -1,50 +1,23 @@
|
||||
if vim.version().minor >= 8 then
|
||||
local function status_line()
|
||||
local file_name = "%-.32t"
|
||||
local modified = " %-m"
|
||||
local right_align = "%="
|
||||
local line_no = "%10([%l/%L%)]"
|
||||
local pct_thru_file = "%5p%%"
|
||||
|
||||
return string.format(
|
||||
"%s%s%s%s%s",
|
||||
file_name,
|
||||
modified,
|
||||
right_align,
|
||||
line_no,
|
||||
pct_thru_file
|
||||
)
|
||||
end
|
||||
|
||||
vim.opt.laststatus = 3
|
||||
-- vim.opt.winbar = status_line()
|
||||
require('lualine').setup({
|
||||
options = { theme = 'gruvbox' },
|
||||
sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
|
||||
inactive_sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
|
||||
globalstatus = true,
|
||||
winbar = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { { 'filename', path = 1, file_status = true } },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { { 'filename', path = 1, file_status = true } },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
})
|
||||
else
|
||||
require('lualine').setup({
|
||||
options = { theme = 'gruvbox' },
|
||||
sections = { lualine_c = { 'filename' } },
|
||||
globalstatus = false,
|
||||
-- inactive_sections = { lualine_c = { 'filename' } },
|
||||
})
|
||||
end
|
||||
vim.opt.laststatus = 3
|
||||
require('lualine').setup({
|
||||
options = { theme = 'gruvbox' },
|
||||
sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
|
||||
inactive_sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
|
||||
globalstatus = true,
|
||||
winbar = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { { 'filename', path = 1, file_status = true } },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { { 'filename', path = 1, file_status = true } },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
dap = require('dap')
|
||||
|
||||
local opts = { noremap = true, silent = false }
|
||||
-- vim.keymap.set('n', '<F5>', dap.continue(), opts)
|
||||
vim.keymap.set('n', '<F5>', ":lua require('dap').continue()<CR>", opts)
|
||||
@ -28,7 +29,9 @@ dap.adapters.python = {
|
||||
};
|
||||
}
|
||||
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
local dap= require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
@ -149,11 +152,11 @@ dap.configurations.cpp = {
|
||||
|
||||
-- EXTENSIONS
|
||||
|
||||
require("nvim-dap-virtual-text").setup()
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
require('telescope').load_extension('dap')
|
||||
-- require("cmp").setup.filetype({ "dap-repl", "dapui_watches" }, {
|
||||
-- sources = {
|
||||
-- { name = "dap" },
|
||||
-- },
|
||||
-- })
|
||||
require("dapui").setup()
|
||||
require('cmp').setup.filetype({ 'dap-repl', 'dapui_watches', 'dapui_hover' }, {
|
||||
sources = {
|
||||
{ name = 'dap' },
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -63,18 +63,10 @@ local on_attach = function(client, bufnr)
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
if vim.version().minor >= 8 then
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
|
||||
else
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, opts)
|
||||
end
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
if vim.version().minor >= 8 then
|
||||
vim.keymap.set('v', '<space>f', vim.lsp.buf.format, opts)
|
||||
else
|
||||
vim.keymap.set('v', '<space>f', vim.lsp.buf.range_formatting, opts)
|
||||
end
|
||||
vim.keymap.set('x', '<space>f', vim.lsp.buf.format, opts)
|
||||
end
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
|
@ -47,5 +47,9 @@ require('neo-tree').setup({
|
||||
hide_gitignored = false,
|
||||
},
|
||||
},
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '\\', '<cmd>Neotree reveal<cr>')
|
||||
|
@ -49,4 +49,3 @@ require('telescope').setup({
|
||||
})
|
||||
|
||||
require('telescope').load_extension('fzf')
|
||||
require('telescope').load_extension('aerial')
|
||||
|
Loading…
x
Reference in New Issue
Block a user