IM SO TIRED OF LSP IN NEOVIM THAT I CODE WITH SYNTAX HIGHLIGHTING ONLY, SEND HELP
This commit is contained in:
parent
7623c7a846
commit
fe47f795c4
|
@ -32,13 +32,13 @@ colors:
|
||||||
white: '#E6EEF3'
|
white: '#E6EEF3'
|
||||||
|
|
||||||
font:
|
font:
|
||||||
size: 9
|
size: 12
|
||||||
normal:
|
normal:
|
||||||
family: Cozette
|
family: Cozette
|
||||||
|
|
||||||
window:
|
window:
|
||||||
padding:
|
padding:
|
||||||
x: 20
|
x: 25
|
||||||
y: 20
|
y: 25
|
||||||
|
|
||||||
background_opacity: 0.85
|
background_opacity: 0.85
|
||||||
|
|
|
@ -11,13 +11,8 @@ set cursorline
|
||||||
" plugins
|
" plugins
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'sainnhe/sonokai'
|
Plug 'sainnhe/sonokai'
|
||||||
Plug 'neovim/nvim-lspconfig'
|
|
||||||
Plug 'preservim/nerdtree'
|
Plug 'preservim/nerdtree'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'hrsh7th/nvim-cmp'
|
|
||||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
||||||
Plug 'saadparwaiz1/cmp_luasnip'
|
|
||||||
Plug 'L3MON4D3/LuaSnip'
|
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
@ -50,89 +45,9 @@ let g:NERDTreeQuitOnOpen = 1
|
||||||
let g:NERDTreeDirArrowExpandable = '>'
|
let g:NERDTreeDirArrowExpandable = '>'
|
||||||
let g:NERDTreeDirArrowCollapsible = '<'
|
let g:NERDTreeDirArrowCollapsible = '<'
|
||||||
|
|
||||||
" LSP stuff
|
" treesitter
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
|
||||||
local nvim_lsp = require('lspconfig')
|
|
||||||
local on_attach = function(client, bufnr)
|
|
||||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
|
||||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
||||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
||||||
local opts = { noremap=true, silent=true }
|
|
||||||
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
|
||||||
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
|
||||||
end
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
|
||||||
|
|
||||||
nvim_lsp.clangd.setup {
|
|
||||||
on_attach = on_attach;
|
|
||||||
capabilities = capabilities;
|
|
||||||
}
|
|
||||||
nvim_lsp.rust_analyzer.setup {
|
|
||||||
on_attach = on_attach;
|
|
||||||
capabilities = capabilities;
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.o.completeopt = 'menuone,noselect'
|
|
||||||
local luasnip = require 'luasnip'
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<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 {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
['<Tab>'] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
['<S-Tab>'] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
ensure_installed = { "c", "toml" },
|
ensure_installed = { "c", "toml" },
|
||||||
highlight = {
|
highlight = {
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
#################################
|
#################################
|
||||||
backend = "glx";
|
backend = "glx";
|
||||||
glx-no-stencil = true;
|
glx-no-stencil = true;
|
||||||
glx-no-rebind-pixmap = true;
|
|
||||||
vsync = true;
|
vsync = true;
|
||||||
xrender-sync-fence = "true";
|
xrender-sync-fence = "true";
|
||||||
glx-swap-method = -1;
|
|
||||||
unredir-if-possible = true;
|
unredir-if-possible = true;
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
|
@ -25,16 +23,6 @@ shadow-ignore-shaped = false;
|
||||||
inactive-opacity = 0.9;
|
inactive-opacity = 0.9;
|
||||||
active-opacity = 1;
|
active-opacity = 1;
|
||||||
inactive-opacity-override = false;
|
inactive-opacity-override = false;
|
||||||
blur-background = true;
|
|
||||||
blur-background-frame = true;
|
|
||||||
blur-background-fixed = true;
|
|
||||||
blur-background-exclude = [
|
|
||||||
"window_type = 'dock'",
|
|
||||||
"window_type = 'desktop'"
|
|
||||||
];
|
|
||||||
blur-kern = "3x3box";
|
|
||||||
blur-method = "kernel";
|
|
||||||
blur-strength = 10;
|
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Fading
|
# Fading
|
||||||
|
@ -45,6 +33,6 @@ wintypes:
|
||||||
{
|
{
|
||||||
dock = { shadow = false; }
|
dock = { shadow = false; }
|
||||||
dnd = { shadow = false; }
|
dnd = { shadow = false; }
|
||||||
popup_menu = { opacity = 0.8; }
|
popup_menu = { opacity = 0.9; }
|
||||||
dropdown_menu = { opacity = 0.8; }
|
dropdown_menu = { opacity = 0.9; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ configuration{
|
||||||
lines: 10;
|
lines: 10;
|
||||||
font: "Cozette 9";
|
font: "Cozette 9";
|
||||||
show-icons: true;
|
show-icons: true;
|
||||||
terminal: "urxvt";
|
terminal: "alacritty";
|
||||||
drun-display-format: "{icon} {name}";
|
drun-display-format: "{icon} {name}";
|
||||||
display-drun: " > ";
|
display-drun: " > ";
|
||||||
location: 0;
|
location: 0;
|
||||||
|
|
Reference in a new issue