summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--after/plugin/harpoon.lua10
-rw-r--r--after/plugin/lsp.lua14
-rw-r--r--init.lua2
-rw-r--r--lua/linux/init.lua4
-rw-r--r--lua/linux/packer.lua41
-rw-r--r--lua/talha/functions.lua (renamed from lua/linux/functions.lua)0
-rw-r--r--lua/talha/init.lua4
-rw-r--r--lua/talha/packer.lua40
-rw-r--r--lua/talha/remap.lua (renamed from lua/linux/remap.lua)6
-rw-r--r--lua/talha/set.lua (renamed from lua/linux/set.lua)0
-rw-r--r--plugin/packer_compiled.lua19
11 files changed, 82 insertions, 58 deletions
diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua
new file mode 100644
index 0000000..7d2a7a6
--- /dev/null
+++ b/after/plugin/harpoon.lua
@@ -0,0 +1,10 @@
+local mark = require("harpoon.mark")
+local ui = require("harpoon.ui")
+
+vim.keymap.set("n", "<leader>a", mark.add_file)
+vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
+
+vim.keymap.set("n", "<C-f>y", function() ui.nav_file(1) end)
+vim.keymap.set("n", "<C-f>u", function() ui.nav_file(2) end)
+vim.keymap.set("n", "<C-f>i", function() ui.nav_file(3) end)
+vim.keymap.set("n", "<C-f>o", function() ui.nav_file(4) end)
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
index 0bc840d..f8dae3c 100644
--- a/after/plugin/lsp.lua
+++ b/after/plugin/lsp.lua
@@ -9,9 +9,17 @@ end
lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
- lsp.default_keymaps({buffer = bufnr})
-
- local opts = {buffer = bufnr}
+ local opts = {buffer = bufnr, remap = false}
+ vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
+ vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
+ vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
+ vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
+ vim.keymap.set("n", "[d", function() vim.diagnostic.goto_prev() end, opts)
+ vim.keymap.set("n", "]d", function() vim.diagnostic.goto_next() end, opts)
+ vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
+ vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
+ vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
+ vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
lsp.setup()
diff --git a/init.lua b/init.lua
index d738e2e..1105fe8 100644
--- a/init.lua
+++ b/init.lua
@@ -1 +1 @@
-require("linux")
+require("talha")
diff --git a/lua/linux/init.lua b/lua/linux/init.lua
deleted file mode 100644
index 0fbdc54..0000000
--- a/lua/linux/init.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-require("linux.remap")
-require("linux.set")
-require("linux.functions")
-
diff --git a/lua/linux/packer.lua b/lua/linux/packer.lua
deleted file mode 100644
index 704531a..0000000
--- a/lua/linux/packer.lua
+++ /dev/null
@@ -1,41 +0,0 @@
--- TODO: add formatter
-vim.cmd [[packadd packer.nvim]]
-
-return require('packer').startup(function(use)
- -- Packer can manage itself
- use 'wbthomason/packer.nvim'
-
- use {
- 'nvim-telescope/telescope.nvim', tag = '0.1.2',
- -- or , branch = '0.1.x',
- requires = { {'nvim-lua/plenary.nvim'} }
- }
-
-
- use({ 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' })
-
- -- colorschemes
- use { "ellisonleao/gruvbox.nvim" }
- use { "huyvohcmc/atlas.vim" }
- use { "yorickpeterse/vim-paper" }
-
- use('mbbill/undotree')
-
- use('tpope/vim-fugitive')
-
- use {
- 'VonHeikemen/lsp-zero.nvim',
- branch = 'v2.x',
- requires = {
- -- LSP Support
- {'neovim/nvim-lspconfig'}, -- Required
- {'williamboman/mason.nvim'}, -- Optional
- {'williamboman/mason-lspconfig.nvim'}, -- Optional
-
- -- Autocompletion
- {'hrsh7th/nvim-cmp'}, -- Required
- {'hrsh7th/cmp-nvim-lsp'}, -- Required
- {'L3MON4D3/LuaSnip'}, -- Required
- }
- }
-end)
diff --git a/lua/linux/functions.lua b/lua/talha/functions.lua
index 946bfd8..946bfd8 100644
--- a/lua/linux/functions.lua
+++ b/lua/talha/functions.lua
diff --git a/lua/talha/init.lua b/lua/talha/init.lua
new file mode 100644
index 0000000..2babaca
--- /dev/null
+++ b/lua/talha/init.lua
@@ -0,0 +1,4 @@
+require("talha.remap")
+require("talha.set")
+require("talha.functions")
+
diff --git a/lua/talha/packer.lua b/lua/talha/packer.lua
new file mode 100644
index 0000000..eea7520
--- /dev/null
+++ b/lua/talha/packer.lua
@@ -0,0 +1,40 @@
+vim.cmd [[packadd packer.nvim]]
+
+return require('packer').startup(function(use)
+ -- Packer can manage itself
+ use 'wbthomason/packer.nvim'
+
+ use {
+ 'nvim-telescope/telescope.nvim', tag = '0.1.2',
+ -- or , branch = '0.1.x',
+ requires = { {'nvim-lua/plenary.nvim'} }
+ }
+
+
+ use({ 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' })
+
+ -- colorschemes
+ use { "ellisonleao/gruvbox.nvim" }
+
+ use { "theprimeagen/harpoon" }
+
+ use('mbbill/undotree')
+
+ use('tpope/vim-fugitive')
+
+ use {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v2.x',
+ requires = {
+ -- LSP Support
+ {'neovim/nvim-lspconfig'}, -- Required
+ {'williamboman/mason.nvim'}, -- Optional
+ {'williamboman/mason-lspconfig.nvim'}, -- Optional
+
+ -- Autocompletion
+ {'hrsh7th/nvim-cmp'}, -- Required
+ {'hrsh7th/cmp-nvim-lsp'}, -- Required
+ {'L3MON4D3/LuaSnip'}, -- Required
+ }
+ }
+end)
diff --git a/lua/linux/remap.lua b/lua/talha/remap.lua
index dfc7aca..442ec9d 100644
--- a/lua/linux/remap.lua
+++ b/lua/talha/remap.lua
@@ -22,14 +22,16 @@ vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
+vim.keymap.set("x", "<leader>p", "\"_dP")
+
-- copying to system clipboard
vim.keymap.set("n", "<leader>y", [["+y]])
vim.keymap.set("v", "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
-- deleting without polluting vim clipboard
-vim.keymap.set("n", "<leader>d", [["_d]])
-vim.keymap.set("v", "<leader>d", [["_d]])
+vim.keymap.set({"n", "x"}, "x", [["_x]])
+vim.keymap.set({"n", "x"}, "X", [["_d]])
-- global substitute the word cursor is on in current file
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
diff --git a/lua/linux/set.lua b/lua/talha/set.lua
index 0366b03..0366b03 100644
--- a/lua/linux/set.lua
+++ b/lua/talha/set.lua
diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua
index 08593d0..1663afb 100644
--- a/plugin/packer_compiled.lua
+++ b/plugin/packer_compiled.lua
@@ -49,8 +49,8 @@ local function save_profiles(threshold)
end
time([[Luarocks path setup]], true)
-local package_path_str = "/home/talha/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
-local install_cpath_pattern = "/home/talha/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
+local package_path_str = "/home/talha/.cache/nvim/packer_hererocks/2.1.1692716794/share/lua/5.1/?.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.1692716794/share/lua/5.1/?/init.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.1692716794/lib/luarocks/rocks-5.1/?.lua;/home/talha/.cache/nvim/packer_hererocks/2.1.1692716794/lib/luarocks/rocks-5.1/?/init.lua"
+local install_cpath_pattern = "/home/talha/.cache/nvim/packer_hererocks/2.1.1692716794/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
@@ -84,6 +84,16 @@ _G.packer_plugins = {
path = "/home/talha/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
+ ["gruvbox.nvim"] = {
+ loaded = true,
+ path = "/home/talha/.local/share/nvim/site/pack/packer/start/gruvbox.nvim",
+ url = "https://github.com/ellisonleao/gruvbox.nvim"
+ },
+ harpoon = {
+ loaded = true,
+ path = "/home/talha/.local/share/nvim/site/pack/packer/start/harpoon",
+ url = "https://github.com/theprimeagen/harpoon"
+ },
["lsp-zero.nvim"] = {
loaded = true,
path = "/home/talha/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
@@ -124,11 +134,6 @@ _G.packer_plugins = {
path = "/home/talha/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
- ["rose-pine"] = {
- loaded = true,
- path = "/home/talha/.local/share/nvim/site/pack/packer/start/rose-pine",
- url = "https://github.com/rose-pine/neovim"
- },
["telescope.nvim"] = {
loaded = true,
path = "/home/talha/.local/share/nvim/site/pack/packer/start/telescope.nvim",