a bunch more goodies
This commit is contained in:
parent
7aead9ddc0
commit
ecac56d052
10
init.vim
10
init.vim
|
@ -4,6 +4,10 @@ let $SCR_INIT = $CONFIG . '/init.vim'
|
|||
|
||||
if has('win32')
|
||||
source $VIMRUNTIME/mswin.vim
|
||||
else
|
||||
nmap <c-C> "+y
|
||||
vmap <c-C> "+y
|
||||
nmap <c-V> "+p
|
||||
endif
|
||||
|
||||
set termguicolors
|
||||
|
@ -15,7 +19,11 @@ set tabstop=2 softtabstop=0 shiftwidth=2 expandtab smarttab autoindent
|
|||
set incsearch ignorecase smartcase hlsearch
|
||||
set wildmode=longest,list,full wildmenu
|
||||
set ruler laststatus=2 showcmd showmode
|
||||
" set list listchars=trail:
|
||||
set list
|
||||
set listchars=tab:➫\ ,trail:░
|
||||
hi EoLSpace ctermbg=238 guibg=#333333
|
||||
match EoLSpace /\s\+$/
|
||||
|
||||
set fillchars+=vert:\
|
||||
set wrap breakindent
|
||||
set encoding=utf-8
|
||||
|
|
244
lua/plugins.lua
244
lua/plugins.lua
|
@ -7,8 +7,6 @@ if fn.empty(fn.glob(install_path)) > 0 then
|
|||
-- TODO: It seems sqlite needs installing or configuring on gentoo as well.
|
||||
end
|
||||
|
||||
lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
|
@ -20,7 +18,10 @@ return require('packer').startup(function(use)
|
|||
use 'kyazdani42/nvim-web-devicons'
|
||||
use {
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', 'glacambre/firenvim' },
|
||||
cond = function()
|
||||
return not vim.g.started_by_firenvim
|
||||
end,
|
||||
config = function()
|
||||
require('nvim-tree').setup {
|
||||
update_cwd = true
|
||||
|
@ -30,6 +31,10 @@ return require('packer').startup(function(use)
|
|||
use 'bryanmylee/vim-colorscheme-icons'
|
||||
use {
|
||||
'akinsho/bufferline.nvim',
|
||||
requires = 'glacambre/firenvim',
|
||||
cond = function()
|
||||
return not vim.g.started_by_firenvim
|
||||
end,
|
||||
config = function()
|
||||
require('bufferline').setup {
|
||||
options = {
|
||||
|
@ -40,6 +45,10 @@ return require('packer').startup(function(use)
|
|||
}
|
||||
use {
|
||||
'NTBBloodbath/galaxyline.nvim',
|
||||
requires = 'glacambre/firenvim',
|
||||
cond = function()
|
||||
return not vim.g.started_by_firenvim
|
||||
end,
|
||||
config = function()
|
||||
require('galaxyline.themes.minimalist')
|
||||
end,
|
||||
|
@ -56,7 +65,14 @@ return require('packer').startup(function(use)
|
|||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-smart-history.nvim' },
|
||||
requires = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope-smart-history.nvim',
|
||||
'glacambre/firenvim'
|
||||
},
|
||||
cond = function()
|
||||
return not vim.g.started_by_firenvim
|
||||
end,
|
||||
config = function()
|
||||
local tele = require('telescope')
|
||||
local actions = require('telescope.actions');
|
||||
|
@ -142,46 +158,57 @@ return require('packer').startup(function(use)
|
|||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
config = function()
|
||||
-- Mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
local opts = { noremap=true, silent=true }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||
-- this suda thing does not work... maybe can hack suda
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
-- trying to haxx suda
|
||||
--local declaration = vim.lsp.handlers['textDocument/declaration']
|
||||
--vim.lsp.handlers['textDocument/declaration'] = vim.lsp.with(
|
||||
-- function()
|
||||
-- vim.g.suda_smart_edit = 0
|
||||
-- declaration()
|
||||
-- vim.g.suda_smart_edit = 1
|
||||
-- end)
|
||||
|
||||
require('lspconfig').gdscript.setup{
|
||||
capabilities = lsp_client_capabilities
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
require('lspconfig').clangd.setup{
|
||||
on_attach = on_attach,
|
||||
}
|
||||
end,
|
||||
requires = { 'hrsh7th/cmp-nvim-lsp' }
|
||||
}
|
||||
use {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
config = function()
|
||||
lsp_client_capabilities = require('cmp_nvim_lsp').update_capabilities(lsp_client_capabilities)
|
||||
end
|
||||
}
|
||||
use 'hrsh7th/cmp-nvim-lua'
|
||||
use 'hrsh7th/cmp-emoji'
|
||||
use 'hrsh7th/cmp-path'
|
||||
use 'hrsh7th/cmp-buffer'
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<TAB>'] = cmp.mapping.confirm({ select = true })
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'emoji' },
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lua' },
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
use {
|
||||
|
@ -212,6 +239,7 @@ return require('packer').startup(function(use)
|
|||
use {
|
||||
'neoclide/coc.nvim',
|
||||
branch = 'release',
|
||||
enabled = false,
|
||||
config = function()
|
||||
vim.g.coc_global_extensions = {
|
||||
'coc-cmake',
|
||||
|
@ -287,6 +315,138 @@ return require('packer').startup(function(use)
|
|||
use { 'andrewstuart/vim-kubernetes' }
|
||||
use { 'arrufat/vala.vim' }
|
||||
use { 'pirmd/gemini.vim' }
|
||||
use {
|
||||
'glacambre/firenvim',
|
||||
run = function() vim.fn['firenvim#install'](0) end,
|
||||
config = function()
|
||||
if vim.g.started_by_firenvim then
|
||||
vim.o.laststatus = 0
|
||||
vim.o.number = false
|
||||
vim.o.guifont = 'JetBrains Mono:h9'
|
||||
vim.o.wrap = true
|
||||
vim.o.textwidth = 0
|
||||
vim.o.linebreak = true
|
||||
|
||||
local timer = nil
|
||||
local maybe_start_timer = function()
|
||||
if timer and timer:get_due_in() > 0 then
|
||||
return
|
||||
end
|
||||
|
||||
timer = vim.defer_fn(function()
|
||||
vim.api.nvim_command('write')
|
||||
end, 10000)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
"BufEnter",
|
||||
{
|
||||
pattern = 'write.trees.st_*.txt',
|
||||
command = 'set filetype=markdown | set tw=0'
|
||||
}
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'TextChanged', 'TextChangedI' },
|
||||
{
|
||||
pattern = '*',
|
||||
nested = true,
|
||||
callback = maybe_start_timer,
|
||||
}
|
||||
)
|
||||
|
||||
vim.g.firenvim_config = {
|
||||
globalSettings = {
|
||||
alt = 'all',
|
||||
},
|
||||
localSettings = {
|
||||
['.*'] = {
|
||||
takeover = 'never'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end
|
||||
end
|
||||
}
|
||||
use { 'dstein64/nvim-scrollview' }
|
||||
use { 'ziglang/zig.vim' }
|
||||
use {
|
||||
'mfussenegger/nvim-dap',
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = '/usr/bin/lldb-vscode',
|
||||
name = 'lldb'
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = 'Launch',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
runInTermanl = false,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<F5>', "<Cmd>lua require'dap'.continue()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<F9>', "<Cmd>lua require'dap'.step_over()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<F10>', "<Cmd>lua require'dap'.step_into()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<F12>', "<Cmd>lua require'dap'.step_out()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>b', "<Cmd>lua require'dap'.toggle_breakpoint()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>B', "<Cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint Cond: '))<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lp', "<Cmd>lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Logpoint msg: '))<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>dr', "<Cmd>lua require'dap'.repl.open()<CR>", {noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>dl', "<Cmd>lua require'dap'.repl.run_last()<CR>", {noremap=true})
|
||||
end
|
||||
}
|
||||
use {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
requires = { 'mfussenegger/nvim-dap' },
|
||||
config = function()
|
||||
local dap, dapui = require('dap'), require('dapui')
|
||||
dapui.setup()
|
||||
vim.api.nvim_create_user_command('Dapui', function() dapui.open(1) end, { nargs = 0 })
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
}
|
||||
use {
|
||||
'voldikss/vim-floaterm',
|
||||
config = function()
|
||||
vim.api.nvim_create_user_command('Gitui', function() vim.api.nvim_exec('FloatermNew gitui', false) end, { nargs = 0 })
|
||||
vim.g.floaterm_keymap_new = '<Leader>tn'
|
||||
vim.g.floaterm_keymap_toggle = '<Leader>tt'
|
||||
vim.g.floaterm_keymap_show = '<Leader>ts'
|
||||
vim.g.floaterm_keymap_hide = '<Leader>th'
|
||||
vim.g.floaterm_keymap_kill = '<Leader>tk'
|
||||
vim.g.floaterm_keymap_prev = '<Leader>t<left>'
|
||||
vim.g.floaterm_keymap_next = '<Leader>t<right>'
|
||||
vim.g.floaterm_title = 'term $1/$2'
|
||||
vim.g.floaterm_width = 0.95
|
||||
vim.g.floaterm_height = 0.95
|
||||
vim.g.floaterm_borderchars = "─│─│╭╮╯╰"
|
||||
vim.api.nvim_set_keymap('n', '<Leader>tg', "<Cmd>Gitui<CR>", {noremap=true})
|
||||
end
|
||||
}
|
||||
end)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue