tidy-up: Organize dot files
This commit is contained in:
parent
456046c4a7
commit
51973fcbf4
18 changed files with 3 additions and 3 deletions
28
.config/nvim/init.vim
Normal file
28
.config/nvim/init.vim
Normal file
|
@ -0,0 +1,28 @@
|
|||
lua require('plugins')
|
||||
lua require('telescope')
|
||||
lua require('config.bindings')
|
||||
lua require('config.telescope')
|
||||
lua require('config.treesitter')
|
||||
lua require('config.lsp')
|
||||
lua require('config.editor')
|
||||
lua require('config.theme')
|
||||
|
||||
set guicursor=
|
||||
set autoindent
|
||||
set wildmode=longest,list
|
||||
set laststatus=0
|
||||
set clipboard+=unnamedplus
|
||||
set background=dark
|
||||
set number
|
||||
set hidden
|
||||
set title
|
||||
set signcolumn=yes:1
|
||||
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
|
||||
colorscheme carbonfox
|
||||
|
||||
hi Normal ctermbg=NONE guibg=NONE
|
||||
hi SignColumn ctermbg=NONE guibg=NONE
|
||||
hi LineNr ctermbg=NONE guibg=none guifg=Grey
|
14
.config/nvim/lua/config/bindings.lua
Normal file
14
.config/nvim/lua/config/bindings.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
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>")
|
||||
|
24
.config/nvim/lua/config/editor.lua
Normal file
24
.config/nvim/lua/config/editor.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
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
|
25
.config/nvim/lua/config/lsp.lua
Normal file
25
.config/nvim/lua/config/lsp.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
lsp = vim.lsp
|
||||
lsp_config = require('lspconfig')
|
||||
cmp_defcaps = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
snippet_engine = 'luasnip'
|
||||
|
||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = '',
|
||||
[vim.diagnostic.severity.WARN] = '',
|
||||
[vim.diagnostic.severity.HINT] = '',
|
||||
[vim.diagnostic.severity.INFO] = '',
|
||||
},
|
||||
},
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
require('lsp.mason')
|
||||
require('lsp.cmp')
|
||||
require('lsp.pylsp')
|
||||
require('lsp.rust')
|
||||
require('lsp.git')
|
15
.config/nvim/lua/config/telescope.lua
Normal file
15
.config/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
.config/nvim/lua/config/theme.lua
Normal file
29
.config/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
.config/nvim/lua/config/treesitter.lua
Normal file
24
.config/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", "python" },
|
||||
|
||||
-- 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,
|
||||
},
|
||||
}
|
25
.config/nvim/lua/lsp/cmp.lua
Normal file
25
.config/nvim/lua/lsp/cmp.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local cmp = require('cmp')
|
||||
local sneng = require(snippet_engine)
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
sneng.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-n>'] = cmp.mapping.scroll_docs(4),
|
||||
['<tab>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-space>'] = cmp.mapping.complete(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
{ name = sneng_name },
|
||||
})
|
||||
})
|
7
.config/nvim/lua/lsp/git.lua
Normal file
7
.config/nvim/lua/lsp/git.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
require('vgit').setup({
|
||||
settings = {
|
||||
signs = {
|
||||
priority = 0,
|
||||
},
|
||||
}
|
||||
})
|
4
.config/nvim/lua/lsp/mason.lua
Normal file
4
.config/nvim/lua/lsp/mason.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {'rust_analyzer', 'pylsp'},
|
||||
})
|
4
.config/nvim/lua/lsp/pylsp.lua
Normal file
4
.config/nvim/lua/lsp/pylsp.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
lsp.config('pylsp', {
|
||||
capabilities = cmp_defcaps,
|
||||
})
|
||||
lsp.enable('pylsp')
|
11
.config/nvim/lua/lsp/rust.lua
Normal file
11
.config/nvim/lua/lsp/rust.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
lsp.config('rust_analyzer', {
|
||||
capabilities = cmp_defcaps,
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
lsp.enable('rust_analyzer')
|
61
.config/nvim/lua/plugins.lua
Normal file
61
.config/nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,61 @@
|
|||
-- 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('SapphirusBeryl/nightfox.nvim')
|
||||
use('nvim-tree/nvim-web-devicons')
|
||||
|
||||
use('mbbill/undotree')
|
||||
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
-- Mason Package Manager
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/cmp-nvim-lsp-signature-help'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
}
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.x',
|
||||
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 {
|
||||
'tanvirtin/vgit.nvim',
|
||||
requires = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
}
|
||||
}
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue