Initial commit
This commit is contained in:
commit
efb531383d
14 changed files with 525 additions and 0 deletions
13
nvim/lua/config/bindings.lua
Normal file
13
nvim/lua/config/bindings.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
vim.keymap.set("n", "<leader>sy", vim.cmd.PackerSync)
|
||||
vim.keymap.set("n", "<leader>ty", vim.cmd.TSUpdate)
|
||||
vim.keymap.set("n", "<leader>o", "<Cmd>Neotree<CR>")
|
||||
vim.keymap.set("n", "<leader>t", "<Cmd>Neotree toggle<CR>")
|
||||
vim.keymap.set("n", "<leader>p", "<Cmd>bp<CR>")
|
||||
vim.keymap.set("n", "<leader>q", "<Cmd>bd<CR>")
|
||||
vim.keymap.set("n", "<leader>l", "<Cmd>bl<CR>")
|
||||
vim.keymap.set("n", "<leader>lb", "<Cmd>VGit toggle_live_blame<CR>")
|
||||
vim.keymap.set("n", "<leader>bp", "<Cmd>VGit buffer_blame_preview<CR>")
|
21
nvim/lua/config/editor.lua
Normal file
21
nvim/lua/config/editor.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.nu = false
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.wrap = false
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.g.moonflyNormalFloat = true
|
||||
vim.g.moonflyTransparent = true
|
||||
vim.g.moonflyUndercurls = false
|
||||
|
||||
vim.o.updatetime = 300
|
||||
vim.o.incsearch = false
|
||||
|
||||
vim.lsp.buf.signature_help = true
|
72
nvim/lua/config/lsp.lua
Normal file
72
nvim/lua/config/lsp.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local lsp = require("lsp-zero")
|
||||
local git = require("vgit")
|
||||
local sig = require("lsp_signature")
|
||||
local cmp = require("cmp")
|
||||
local cmp_action = require("lsp-zero").cmp_action()
|
||||
|
||||
lsp.preset("recommended")
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {'rust_analyzer'},
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp_action.luasnip_jump_backward(),
|
||||
['<C-n>'] = cmp_action.luasnip_jump_forward(),
|
||||
['<tab>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-space>'] = cmp.mapping.complete(),
|
||||
})
|
||||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
sign_icons = { }
|
||||
})
|
||||
|
||||
lsp.set_sign_icons({
|
||||
error = '',
|
||||
warn = '',
|
||||
hint = '',
|
||||
info = '',
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, 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.lps.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_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.diagnostic.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.diagnostic.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.diagnostic.rename() end, opts)
|
||||
vim.keymap.set("n", "<C-h>", function() vim.diagnostic.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
|
||||
lsp.setup()
|
||||
-- sig.setup({
|
||||
-- hint_enable = false,
|
||||
-- fix_pos = ,
|
||||
-- always_trigger = true,
|
||||
-- handler_opts = {
|
||||
-- border = "rounded" -- double, rounded, single, shadow, none, or a table of borders
|
||||
-- },
|
||||
--})
|
||||
git.setup({
|
||||
settings = {
|
||||
signs = {
|
||||
priority = 0,
|
||||
},
|
||||
}
|
||||
})
|
15
nvim/lua/config/telescope.lua
Normal file
15
nvim/lua/config/telescope.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>f', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>g', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>b', builtin.buffers, {})
|
||||
|
||||
require('telescope').setup{
|
||||
defaults = {
|
||||
file_ignore_patterns = {
|
||||
"target",
|
||||
"dist/runtime",
|
||||
"dist/filesystem",
|
||||
}
|
||||
}
|
||||
}
|
29
nvim/lua/config/theme.lua
Normal file
29
nvim/lua/config/theme.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require('nightfox').setup({
|
||||
options = {
|
||||
transparent = true, -- Disable setting background
|
||||
terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
|
||||
dim_inactive = false, -- Non focused panes set to alternative background
|
||||
module_default = true, -- Default enable value for modules
|
||||
},
|
||||
palettes = {
|
||||
all = { -- Normal terminal colour scheme
|
||||
black = "#16161c",
|
||||
blue = "#26bbd9",
|
||||
cyan = "#59e1e3",
|
||||
green = "#29d398",
|
||||
magenta = "#ee64ac",
|
||||
red = "#e95678",
|
||||
white = "#d5d8da",
|
||||
orange = "#fab795",
|
||||
yellow = "#fbc3a7",
|
||||
},
|
||||
},
|
||||
specs = {
|
||||
all = {
|
||||
syntax = {
|
||||
builtin0 = "blue.bright",
|
||||
comment = "white.dim",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
24
nvim/lua/config/treesitter.lua
Normal file
24
nvim/lua/config/treesitter.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query" , "rust" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
}
|
67
nvim/lua/plugins.lua
Normal file
67
nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
|
||||
|
||||
-- Only required if you have packer configured as `opt`
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- Packer can manage itself
|
||||
use('wbthomason/packer.nvim')
|
||||
|
||||
|
||||
use('olimorris/onedarkpro.nvim')
|
||||
use('EdenEast/nightfox.nvim')
|
||||
use('nvim-tree/nvim-web-devicons')
|
||||
|
||||
use('nvim-treesitter/playground');
|
||||
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
|
||||
|
||||
use('mbbill/undotree')
|
||||
|
||||
use('williamboman/mason.nvim')
|
||||
use('williamboman/mason-lspconfig.nvim')
|
||||
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
}
|
||||
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
requires = {
|
||||
--- Uncomment the two plugins below if you want to manage the language servers from neovim
|
||||
-- {'williamboman/mason.nvim'},
|
||||
-- {'williamboman/mason-lspconfig.nvim'},
|
||||
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'},
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
}
|
||||
}
|
||||
|
||||
use {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
}
|
||||
|
||||
use {
|
||||
'tanvirtin/vgit.nvim',
|
||||
requires = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
}
|
||||
}
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue