Update themes and some key bindings

This commit is contained in:
Saeed Afzal
2022-08-26 10:46:51 +01:00
parent 381c2d2687
commit ab22aeeeb9
8 changed files with 64 additions and 20 deletions

View File

@@ -0,0 +1,14 @@
vim.g.catppuccin_flavour = "mocha"
require("catppuccin").setup {
styles = {
loops = { "italic" },
functions = { "italic", "bold" }
},
integrations = {
lsp_trouble = true,
which_key = true,
barbar = true
}
}

View File

@@ -12,7 +12,9 @@ cmp.setup {
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true })
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item()
}),
sources = cmp.config.sources({

View File

@@ -5,6 +5,7 @@ require("lsp-setup").setup {
gopls = {},
cssls = {},
jsonls = {},
html = {}
html = {},
pylsp = {}
}
}

View File

@@ -1,6 +1,6 @@
require("lualine").setup {
options = {
theme = "tokyonight"
theme = "catppuccin"
},
extensions = {

View File

@@ -1,5 +1,3 @@
local g = vim.g
vim.g.tokyonight_italic_functions = true
vim.cmd[[colorscheme tokyonight]]

View File

@@ -1,50 +1,68 @@
local wk = require("which-key")
wk.setup {
ignore_missing = false
-- TODO: Change to true
ignore_missing = false,
key_labels = {
["<space>"] = "SPC"
}
}
wk.register({
["<leader>"] = {
-- Barbar
-- Files
["<space>"] = { "<cmd>Telescope fd<CR>", "find files" },
-- Buffers
b = {
name = "Barbar",
x = { "<cmd>BufferClose<CR>", "Close Buffer" },
n = { "<cmd>BufferMoveNext<CR>", "Move Next" },
m = { "<cmd>BufferMovePrevious<CR>", "Move Previous" },
name = "buffers",
x = { "<cmd>BufferClose<CR>", "close buffer" },
n = { "<cmd>BufferMoveNext<CR>", "move next" },
m = { "<cmd>BufferMovePrevious<CR>", "move previous" },
f = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "find in current buffer" },
p = {
name = "Pinned Buffers",
p = { "<cmd>BufferPin<CR>", "Pin Buffer" },
x = { "<cmd>BufferCloseAllButPinned<CR>", "Close All But Pinned" }
name = "pinned buffers",
p = { "<cmd>BufferPin<CR>", "pin buffer" },
x = { "<cmd>BufferCloseAllButPinned<CR>", "close all but pinned" }
}
},
-- Telescope
t = {
name = "Telescope",
w = { "<cmd>Telescope live_grep<CR>", "Live Grep" },
f = { "<cmd>Telescope fd<CR>", "Find Files" },
c = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "Find In Current Buffer" },
w = { "<cmd>Telescope live_grep<CR>", "live grep" },
b = { "<cmd>Telescope buffers<CR>", "Buffers" },
k = { "<cmd>Telescope keymaps<CR>", "Keymaps" },
t = { "<cmd>TodoTelescope<CR>", "Todos" }
t = { "<cmd>TodoTelescope<CR>", "Todos" },
c = { "<cmd>TodoTelescope<CR>", "" },
["."] = { "<cmd>Telescope keymaps<CR>", "Global Keymaps" }
},
-- Git
g = {
name = "Git",
b = { "<cmd>Gitsigns blame_line<CR>", "Blame Line" },
d = { "<cmd>Gitsigns diffthis<CR>", "Diff" }
},
-- LSP
l = {
name = "LSP",
a = { "<cmd>vim.lsp.buf.code_action()<CR>", "Code Action" },
f = { "<cmd>vim.lsp.buf.formatting()<CR>", "Format" },
n = { "<cmd>vim.lsp.buf.rename()<CR>", "Rename" }
}
},
-- NvimTree
["<C-n>"] = { "<cmd>NvimTreeToggle<CR>", "NvimTree Toggle" },
-- Barbar (switching buffers)
-- Switching Buffers
["<TAB>"] = { "<cmd>BufferNext<CR>", "Next Buffer" },
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "Previous Buffer" },
-- Trouble
["t"] = {
name = "Trouble",
t = { "<cmd>TroubleToggle<CR>", "Trouble Toggle" },

View File

@@ -1,9 +1,12 @@
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
packer_bootstrap = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim",
install_path })
print("Installing packer: close and reopen Neovim...")
end
require("plugins.setup")
require("plugins.barbar_nvimtree")
vim.cmd [[colorscheme catppuccin]]

View File

@@ -10,6 +10,14 @@ require("packer").startup(function(use)
end
}
use {
"catppuccin/nvim",
as = "catppuccin",
config = function()
require("plugins.config.catppuccin")
end
}
use {
"kyazdani42/nvim-web-devicons",
config = function()