This commit is contained in:
Gvidas Juknevičius 2024-08-08 16:15:44 +03:00
parent d2219b0ff1
commit 918bf56119
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
6 changed files with 140 additions and 2 deletions

13
.config/nvim/.luarc.json Normal file
View File

@ -0,0 +1,13 @@
{
"runtime.version": "LuaJIT",
"runtime.path": [
"lua/?.lua",
"lua/?/init.lua"
],
"diagnostics.globals": ["vim"],
"workspace.checkThirdParty": false,
"workspace.library": [
"$VIMRUNTIME",
"${3rd}/luv/library"
]
}

View File

@ -22,5 +22,6 @@
"nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" }, "nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" },
"nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" }, "nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" } "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
} }

View File

@ -0,0 +1,107 @@
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v1.x',
dependencies = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
{'lvimuser/lsp-inlayhints.nvim'},
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'hrsh7th/cmp-buffer'}, -- Optional
{'hrsh7th/cmp-path'}, -- Optional
{'saadparwaiz1/cmp_luasnip'}, -- Optional
{'hrsh7th/cmp-nvim-lua'}, -- Optional
-- Snippets
{'L3MON4D3/LuaSnip'}, -- Required
{'rafamadriz/friendly-snippets'}, -- Optional
},
init = function()
local lsp_zero = require('lsp-zero')
local ih = require('lsp-inlayhints')
ih.setup()
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
-- ih.on_attach(client, bufnr)
end)
require('mason').setup({})
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
ih.on_attach(client, bufnr)
end,
})
end,
},
})
local cmp = require("cmp")
cmp.setup({
expand = function(args)
vim.snippet.expand(args.body)
end,
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-j>'] = cmp.mapping.scroll_docs(4),
['<C-Tab>'] = cmp.mapping.complete(),
['<Esc>/home/yourname/Documents/CC-Tweaked-EmmyLua'] = cmp.mapping.abort(),
-- Accept currently selected item.
-- Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- require('lspconfig').clangd.setup({})
require('lspconfig').lua_ls.setup({
settings = {
Lua = {}
},
on_init = function(client)
local uv = vim.uv or vim.loop
local path = client.workspace_folders[1].name
-- Don't do anything if there is a project local config
if uv.fs_stat(path .. '/.luarc.json') or
uv.fs_stat(path .. '/.luarc.jsonc') then
return
end
-- Apply neovim specific settings
local lua_opts = lsp_zero.nvim_lua_ls()
client.config.settings.Lua = vim.tbl_deep_extend(
'force',
client.config.settings.Lua,
lua_opts.settings.Lua
)
end
})
end
};

View File

@ -0,0 +1,12 @@
return {
'nvim-telescope/telescope.nvim', tag = '0.1.8',
init = function ()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fs', builtin.grep_string, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set('n', '<leader>ft', builtin.treesitter, {})
end
}

View File

@ -1,6 +1,8 @@
#!/usr/bin/bash #!/usr/bin/bash
sleep 1
pushd ~/.dwm/sources/dim pushd ~/.dwm/sources/dim
~/.dwm/sources/dim/dim & ~/.dwm/sources/dim/target/release/dim 2>&1 | tee dim.log &
popd popd
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
dex --autostart --environment dwm & dex --autostart --environment dwm &

3
.zshrc
View File

@ -27,6 +27,8 @@ alias vim="nvim"
alias yt-dlp="yt-dlp -o \"%(title)s.%(ext)s\"" alias yt-dlp="yt-dlp -o \"%(title)s.%(ext)s\""
alias gpg="gpg --allow-non-selfsigned-uid" alias gpg="gpg --allow-non-selfsigned-uid"
alias ysap="curl ysap.daveeddy.com" alias ysap="curl ysap.daveeddy.com"
alias get_idf='. $HOME/esp/esp-idf/export.sh'
. $HOME/export-esp.sh
# Aditional Paths # Aditional Paths
export PATH="$PATH:/usr/lib/ruby/gems/3.0.0/gems" export PATH="$PATH:/usr/lib/ruby/gems/3.0.0/gems"
@ -39,3 +41,4 @@ function displayqr() {
# Created by `pipx` on 2024-04-13 08:08:20 # Created by `pipx` on 2024-04-13 08:08:20
export PATH="$PATH:/home/mcorange/.local/bin" export PATH="$PATH:/home/mcorange/.local/bin"
export PATH="$HOME/.cargo/bin:$PATH"