Add plugins and config
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
plugin
|
plugin
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Neovim Config
|
# Neovim Config
|
||||||
|
|
||||||
## Requirements:
|
## Requirements
|
||||||
* Git
|
* Git
|
||||||
* [ripgrep](https://github.com/BurntSushi/ripgrep)
|
* [ripgrep](https://github.com/BurntSushi/ripgrep)
|
||||||
* [fd](https://github.com/sharkdp/fd)
|
* [fd](https://github.com/sharkdp/fd)
|
||||||
|
|||||||
@@ -21,3 +21,6 @@ opt.expandtab = true
|
|||||||
opt.smartindent = true
|
opt.smartindent = true
|
||||||
opt.shiftwidth = 4
|
opt.shiftwidth = 4
|
||||||
opt.tabstop = 4
|
opt.tabstop = 4
|
||||||
|
|
||||||
|
-- Neovide GUI
|
||||||
|
require("core.neovide")
|
||||||
|
|||||||
16
lua/core/neovide.lua
Normal file
16
lua/core/neovide.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
local g = vim.g
|
||||||
|
local keymap = vim.keymap
|
||||||
|
|
||||||
|
g.neovide_scale_factor = 1.0
|
||||||
|
|
||||||
|
local change_scale_factor = function(delta)
|
||||||
|
g.neovide_scale_factor = g.neovide_scale_factor * delta
|
||||||
|
end
|
||||||
|
|
||||||
|
keymap.set("n", "<C-=>", function()
|
||||||
|
change_scale_factor(1.25)
|
||||||
|
end)
|
||||||
|
|
||||||
|
keymap.set("n", "<C-->", function()
|
||||||
|
change_scale_factor(1/1.25)
|
||||||
|
end)
|
||||||
@@ -18,7 +18,7 @@ cmp.setup {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim-lsp" },
|
||||||
{ name = "luasnip" }
|
{ name = "luasnip" }
|
||||||
}, {
|
}, {
|
||||||
{ name = "buffer" }
|
{ name = "buffer" }
|
||||||
|
|||||||
3
lua/plugins/config/illuminate.lua
Normal file
3
lua/plugins/config/illuminate.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
require("illuminate").configure {
|
||||||
|
|
||||||
|
}
|
||||||
10
lua/plugins/config/mason.lua
Normal file
10
lua/plugins/config/mason.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
local mason = require("mason-lspconfig")
|
||||||
|
local lsp = require("lspconfig")
|
||||||
|
|
||||||
|
mason.setup{}
|
||||||
|
|
||||||
|
mason.setup_handlers {
|
||||||
|
function (server_name)
|
||||||
|
lsp[server_name].setup{}
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
require("toggleterm").setup {
|
require("toggleterm").setup {
|
||||||
open_mapping = [[<C-t>]],
|
size = function(term)
|
||||||
|
if term.direction == "horizontal" then
|
||||||
|
return 25
|
||||||
|
elseif term.direction == "vertical" then
|
||||||
|
return vim.o.columns * 0.4
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
open_mapping = [[<c-t>]],
|
||||||
direction = "float",
|
direction = "float",
|
||||||
float_opts = {
|
float_opts = {
|
||||||
border = "curved"
|
border = "curved"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ wk.register({
|
|||||||
name = "Find",
|
name = "Find",
|
||||||
f = { "<cmd>Telescope fd<CR>", "find file" },
|
f = { "<cmd>Telescope fd<CR>", "find file" },
|
||||||
w = { "<cmd>Telescope live_grep<CR>", "live grep" },
|
w = { "<cmd>Telescope live_grep<CR>", "live grep" },
|
||||||
|
s = { "<cmd>Telescope spell_suggest<CR>", "spell suggest" },
|
||||||
b = { "<cmd>Telescope buffers<CR>", "all buffers" },
|
b = { "<cmd>Telescope buffers<CR>", "all buffers" },
|
||||||
t = { "<cmd>TodoTelescope<CR>", "todos" },
|
t = { "<cmd>TodoTelescope<CR>", "todos" },
|
||||||
["."] = { "<cmd>Telescope keymaps<CR>", "keymaps" }
|
["."] = { "<cmd>Telescope keymaps<CR>", "keymaps" }
|
||||||
@@ -20,15 +21,18 @@ wk.register({
|
|||||||
|
|
||||||
l = {
|
l = {
|
||||||
name = "LSP",
|
name = "LSP",
|
||||||
r = { "<cmd>lua vim.lsp.buf.rename()<CR>", "rename" },
|
r = { "<cmd>lua require('cosmic-ui').rename()<CR>", "rename" },
|
||||||
d = { "<cmd>Telescope diagnostics<CR>", "diagnostics" },
|
d = { "<cmd>Telescope diagnostics<CR>", "diagnostics" },
|
||||||
f = { "<cmd>lua vim.lsp.buf.format { async = true }<CR>", "format" },
|
f = { "<cmd>lua vim.lsp.buf.format { async = true }<CR>", "format" },
|
||||||
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "code action" }
|
a = { "<cmd>CodeActionMenu<CR>", "code action" }
|
||||||
},
|
},
|
||||||
|
|
||||||
b = {
|
b = {
|
||||||
name = "Buffer",
|
name = "Buffer",
|
||||||
p = { "<cmd>BufferPick<CR>", "pick buffer" }
|
p = { "<cmd>BufferPick<CR>", "pick buffer" },
|
||||||
|
q = { "<cmd>BufferMovePrevious<CR>", "move buffer left" },
|
||||||
|
w = { "<cmd>BufferMoveNext<CR>", "move buffer right" },
|
||||||
|
x = { "<cmd>BufferCloseAllButCurrent<CR>", "close all but current" }
|
||||||
},
|
},
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
@@ -42,7 +46,13 @@ wk.register({
|
|||||||
x = { "<cmd>BufferClose<CR>", "close buffer" },
|
x = { "<cmd>BufferClose<CR>", "close buffer" },
|
||||||
r = { "<cmd>NvimTreeRefresh<CR>", "refresh tree" },
|
r = { "<cmd>NvimTreeRefresh<CR>", "refresh tree" },
|
||||||
c = { "<cmd>Telescope colorscheme<CR>", "colorscheme" },
|
c = { "<cmd>Telescope colorscheme<CR>", "colorscheme" },
|
||||||
s = { "<cmd>SymbolsOutline<CR>", "symbols outline" }
|
s = { "<cmd>SymbolsOutline<CR>", "symbols outline" },
|
||||||
|
h = { "<cmd>noh<CR>", "no highlight" },
|
||||||
|
|
||||||
|
t = {
|
||||||
|
name = "Terminal",
|
||||||
|
t = { "<cmd>ToggleTerm direction=horizontal<CR>", "open terminal" }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
t = {
|
t = {
|
||||||
@@ -61,9 +71,12 @@ wk.register({
|
|||||||
["<C-k>"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "signature help" },
|
["<C-k>"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "signature help" },
|
||||||
|
|
||||||
-- Nvim Tree
|
-- Nvim Tree
|
||||||
["<C-n>"] = { "<cmd>NvimTreeToggle<CR>", "toggle nvimtree" },
|
["<C-n>"] = { "<cmd>NvimTreeToggle .<CR>", "toggle nvimtree" },
|
||||||
|
|
||||||
-- Switching Buffers
|
-- Switching Buffers
|
||||||
["<TAB>"] = { "<cmd>BufferNext<CR>", "next buffer" },
|
["<TAB>"] = { "<cmd>BufferNext<CR>", "next buffer" },
|
||||||
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "previous buffer" }
|
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "previous buffer" },
|
||||||
|
|
||||||
|
-- Find in file
|
||||||
|
["<C-f>"] = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "find in file" }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -82,4 +82,161 @@ return packer.startup(function(use)
|
|||||||
require("plugins.config.blankline")
|
require("plugins.config.blankline")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
config = function()
|
||||||
|
require("Comment").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
tag = "*",
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.toggleterm")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require("alpha").setup(require("alpha.themes.dashboard").config)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Teleport
|
||||||
|
|
||||||
|
use {
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
run = "make"
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.1.1",
|
||||||
|
requires = "nvim-lua/plenary.nvim",
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.telescope")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
use {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
requires = "neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
requires = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"williamboman/mason.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.mason")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
requires = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.cmp")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
requires = "L3MON4D3/LuaSnip"
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"ray-x/lsp_signature.nvim",
|
||||||
|
after = "nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require("lsp_signature").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function()
|
||||||
|
require("nvim-autopairs").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require("trouble").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
requires = "nvim-lua/plenary.nvim",
|
||||||
|
config = function()
|
||||||
|
require("todo-comments").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
config = function()
|
||||||
|
require("symbols-outline").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.whichkey")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"RRethy/vim-illuminate",
|
||||||
|
requires = "neovim/nvim-lspconfig"
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"weilbith/nvim-code-action-menu",
|
||||||
|
requires = "neovim/nvim-lspconfig",
|
||||||
|
cmd = "CodeActionMenu"
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"ellisonleao/glow.nvim",
|
||||||
|
config = function()
|
||||||
|
require("glow").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"CosmicNvim/cosmic-ui",
|
||||||
|
requires = {
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
"nvim-lua/plenary.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("cosmic-ui").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
if packer_bootstrap then
|
||||||
|
require("packer").sync()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user