backport some dwm patches and add new neovim configuration
This commit is contained in:
parent
693bed1a0b
commit
0085d43366
4 changed files with 109 additions and 51 deletions
|
@ -1,5 +1,3 @@
|
||||||
local base16 = require "base16"
|
|
||||||
|
|
||||||
require "plugins"
|
require "plugins"
|
||||||
|
|
||||||
-- thanks nvchad for the telescope config
|
-- thanks nvchad for the telescope config
|
||||||
|
@ -68,7 +66,55 @@ require("nvim-treesitter.configs").setup {
|
||||||
"css",
|
"css",
|
||||||
"c",
|
"c",
|
||||||
"cpp",
|
"cpp",
|
||||||
"rust"
|
"rust",
|
||||||
|
"lua"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||||
|
|
||||||
|
-- Language servers
|
||||||
|
require"lspconfig".clangd.setup{
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
local luasnip = require "luasnip"
|
||||||
|
local cmp = require "cmp"
|
||||||
|
cmp.setup {
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
mapping = {
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.confirm({ select = true })
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +134,11 @@ local init = {
|
||||||
"nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>",
|
"nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>",
|
||||||
"nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>",
|
"nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>",
|
||||||
"nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>",
|
"nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>",
|
||||||
"nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>"
|
"nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>",
|
||||||
|
"let g:gruvbox_material_palette = 'material'",
|
||||||
|
"let g:gruvbox_material_background = 'soft'",
|
||||||
|
"let g:gruvbox_material_better_performance = '1'",
|
||||||
|
"colorscheme gruvbox-material"
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(options) do
|
for k, v in pairs(options) do
|
||||||
|
@ -99,5 +149,4 @@ for i, v in pairs(init) do
|
||||||
vim.cmd(v)
|
vim.cmd(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
base16.apply_theme(base16.themes["tomorrow-night"], true)
|
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,13 @@ return packer.startup(function(use)
|
||||||
branch = "0.5-compat",
|
branch = "0.5-compat",
|
||||||
run = ":TSUpdate"
|
run = ":TSUpdate"
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
"sainnhe/gruvbox-material"
|
||||||
|
}
|
||||||
|
use "neovim/nvim-lspconfig"
|
||||||
|
use "hrsh7th/nvim-cmp"
|
||||||
|
use "hrsh7th/cmp-nvim-lsp"
|
||||||
|
use "saadparwaiz1/cmp_luasnip"
|
||||||
|
use "L3MON4D3/LuaSnip"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ static char *colors[][3] = {
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
|
||||||
static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */
|
static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */
|
||||||
static const unsigned int ulinestroke = 2; /* thickness / height of the underline */
|
static const unsigned int ulinestroke = 0; /* thickness / height of the underline */
|
||||||
static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */
|
static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */
|
||||||
static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */
|
static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */
|
||||||
|
|
||||||
|
|
|
@ -535,6 +535,7 @@ cleanup(void)
|
||||||
drw_cur_free(drw, cursor[i]);
|
drw_cur_free(drw, cursor[i]);
|
||||||
for (i = 0; i < LENGTH(colors) + 1; i++)
|
for (i = 0; i < LENGTH(colors) + 1; i++)
|
||||||
free(scheme[i]);
|
free(scheme[i]);
|
||||||
|
free(scheme); /* backported from https://git.suckless.org/dwm/commit/60e9a14998bfe8666c641f7c27fec18e85ac7494.html */
|
||||||
XDestroyWindow(dpy, wmcheckwin);
|
XDestroyWindow(dpy, wmcheckwin);
|
||||||
drw_free(drw);
|
drw_free(drw);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
Loading…
Reference in a new issue