feat: add polybar config

This commit is contained in:
2021-10-27 20:37:42 +02:00
parent 5ad9266f34
commit 3042da1a97
12 changed files with 353 additions and 125 deletions

View File

@ -4,16 +4,30 @@ local g = vim.g
local options = {noremap = true}
local remap = {noremap = false}
map("n", "<Space>", "<Nop>", remap)
map("n", " ", "<Nop>", remap)
--map("n", "<Space>", "<Nop>", remap)
--map("n", " ", "<Nop>", remap)
g.mapleader = " "
map("n", "<C-p>", ":Telescope find_files<CR>", options)
--map("n", "<C-f>", ":Telescope grep_string<CR>", options)
map("n", "<C-S-f>", ":Telescope live_grep<CR>", options)
map("n", "<C-f>", ":Telescope live_grep<CR>", options)
map("n", "<Leader>c", ":CodeActionMenu<CR>", remap)
-- LSP Functionality
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", options)
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", options)
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", options)
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", options)
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", options)
map("n", "<Leader>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", options)
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", options)
map("n", "<Leader><C-f>", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
map("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", options)
map("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", options)
-- Navigate Buffers
map("n", "<C-h>", "<C-w>h", options)
map("n", "<C-j>", "<C-w>j", options)
@ -21,7 +35,7 @@ map("n", "<C-k>", "<C-w>k", options)
map("n", "<C-l>", "<C-w>l", options)
-- Find file in NvimTree
map("n", "<C-f>", ":NvimTreeFindFile<CR><c-w>", options)
map("n", "<Leader>f", ":NvimTreeFindFile<CR><c-w>", options)
-- I aint no weak boy
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options)

View File

@ -15,18 +15,8 @@ local function on_attach(client)
-- Mappings.
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", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
buf_set_keymap("n", "<Leader>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
buf_set_keymap("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "<Leader><C-f>", "<cmd>lua vim.lsp.buf.code_action()<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)
-- Set some keybinds conditional on server capabilities
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
elseif client.resolved_capabilities.document_range_formatting then

View File

@ -0,0 +1,14 @@
local lsp_installer = require("nvim-lsp-installer")
lsp_installer.on_server_ready(function(server)
local opts = {}
-- (optional) Customize the options passed to the server
-- if server.name == "tsserver" then
-- opts.root_dir = function() ... end
-- end
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
server:setup(opts)
vim.cmd [[ do User LspAttachBuffers ]]
end)

View File

@ -16,6 +16,7 @@ return require("packer").startup(function()
use "kyazdani42/nvim-web-devicons"
use "kyazdani42/nvim-tree.lua"
use "nvim-lua/popup.nvim"
use "mhinz/vim-startify"
-- Code Navigation
use "dense-analysis/ale"
@ -32,7 +33,7 @@ return require("packer").startup(function()
-- Syntax / Autocomplete
use "preservim/nerdcommenter"
use "neovim/nvim-lspconfig"
use "kabouzeid/nvim-lspinstall"
use "williamboman/nvim-lsp-installer"
use "nvim-lua/lsp-status.nvim"
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"

View File

@ -0,0 +1,26 @@
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs()
parser_configs.http = {
install_info = {
url = "https://github.com/NTBBloodbath/tree-sitter-http",
files = {"src/parser.c"},
branch = "main"
}
}
require "nvim-treesitter.configs".setup {
ensure_installed = {
"bash",
"yaml",
"http",
"svelte",
"css",
"svelte",
"typescript",
"javascript",
"go",
"lua",
"yaml"
},
highlight = {enable = true}
}