change structure to use stow for simlink managing
This commit is contained in:
29
.config/nvim/init.lua
Normal file
29
.config/nvim/init.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
require('lazy').setup('plugins')
|
||||
|
||||
-- Settings
|
||||
vim.cmd('source ~/.config/nvim/settings.vim')
|
||||
|
||||
-- colorscheme
|
||||
vim.o.termguicolors = true
|
||||
vim.o.background = "dark" -- or "light" for light mode
|
||||
vim.cmd("colorscheme gruvbox ")
|
||||
|
||||
-- keymaps
|
||||
vim.keymap.set('n', '<leader>/', ':nohlsearch<CR>')
|
||||
vim.keymap.set('n', '<leader>b', ':buffers<CR>')
|
||||
vim.keymap.set('n', 'bp', ':bp<CR>')
|
||||
vim.keymap.set('n', 'bn', ':bn<CR>')
|
||||
|
||||
26
.config/nvim/lazy-lock.json
Normal file
26
.config/nvim/lazy-lock.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "8d7aa7a7b7c0875e4878d1d2590924bc1c229305" },
|
||||
"async.vim": { "branch": "master", "commit": "2082d13bb195f3203d41a308b89417426a7deca1" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
|
||||
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "0a8a1072137d916406507c941698a4bfa9dbbe7a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "92d2501d698e0fe855bd222540f9648890fab6c7" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "fc05fb7c56795f191b6800799a2ec6ea325ba715" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
|
||||
"vim-arsync": { "branch": "master", "commit": "dd5fd93182aafb67ede2ef465f379610980b52d3" }
|
||||
}
|
||||
29
.config/nvim/lua/plugins/gruvbox.lua
Normal file
29
.config/nvim/lua/plugins/gruvbox.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000,
|
||||
config = function ()
|
||||
require("gruvbox").setup({
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
contrast = "soft", -- can be "hard", "soft" or empty string
|
||||
palette_overrides = {},
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = false,
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
23
.config/nvim/lua/plugins/harpoon.lua
Normal file
23
.config/nvim/lua/plugins/harpoon.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
'ThePrimeagen/harpoon',
|
||||
config = function(_, opts)
|
||||
require('harpoon').setup(opts)
|
||||
local mark = require('harpoon'.. ".mark")
|
||||
local ui = require('harpoon'.. ".ui")
|
||||
|
||||
-- Harpoon marked files 1 through 4.
|
||||
vim.keymap.set("n", "<a-1>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<a-2>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<a-3>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<a-4>", function() ui.nav_file(4) end)
|
||||
|
||||
-- Harpoon next and previous.
|
||||
vim.keymap.set("n", "<a-n>", function() ui.nav_next() end)
|
||||
vim.keymap.set("n", "<a-p>", function() ui.nav_prev() end)
|
||||
|
||||
-- Harpoon user interface.
|
||||
vim.keymap.set("n", "<leader>hq", ui.toggle_quick_menu)
|
||||
vim.keymap.set("n", "<leader>ha", mark.add_file)
|
||||
|
||||
end
|
||||
}
|
||||
81
.config/nvim/lua/plugins/lsp-zero.lua
Normal file
81
.config/nvim/lua/plugins/lsp-zero.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
return {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
-- 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
|
||||
{'hrsh7th/cmp-buffer'}, -- Optional
|
||||
{'hrsh7th/cmp-path'}, -- Optional
|
||||
{'saadparwaiz1/cmp_luasnip'}, -- Optional
|
||||
{'hrsh7th/cmp-nvim-lua'}, -- Optional
|
||||
|
||||
|
||||
-- snippets
|
||||
{'L3MON4D3/LuaSnip'}, -- Required
|
||||
{'rafamadriz/friendly-snippets'}, -- Optional
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lsp = require('lsp-zero')
|
||||
lsp.preset('recommended')
|
||||
|
||||
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.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_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>rr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
|
||||
end)
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
local root_pattern = require('lspconfig.util').root_pattern
|
||||
|
||||
lspconfig['jedi_language_server'].setup{
|
||||
root_dir = root_pattern('.git', 'setup.py')
|
||||
}
|
||||
|
||||
lspconfig['lua_ls'].setup{
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_action = require('lsp-zero').cmp_action()
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
||||
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
})
|
||||
|
||||
lsp.setup()
|
||||
end
|
||||
}
|
||||
46
.config/nvim/lua/plugins/lualine.lua
Normal file
46
.config/nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
return{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||
config = function()
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
end
|
||||
}
|
||||
15
.config/nvim/lua/plugins/render-makdown.lua
Normal file
15
.config/nvim/lua/plugins/render-makdown.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
|
||||
config = function()
|
||||
require('render-markdown').setup({
|
||||
render_modes = true,
|
||||
})
|
||||
end
|
||||
}
|
||||
20
.config/nvim/lua/plugins/telescope.lua
Normal file
20
.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.2',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
|
||||
require('telescope').setup{
|
||||
pickers = {
|
||||
find_files = {
|
||||
theme = "dropdown",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end
|
||||
}
|
||||
46
.config/nvim/lua/plugins/treesitter.lua
Normal file
46
.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
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", "python", "bash", "make" },
|
||||
|
||||
-- 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,
|
||||
|
||||
-- List of parsers to ignore installing (for "all")
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
---- 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
|
||||
-- disable = { "c", "rust" },
|
||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
end }
|
||||
22
.config/nvim/lua/plugins/vim-arsync.lua
Normal file
22
.config/nvim/lua/plugins/vim-arsync.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
'KenN7/vim-arsync',
|
||||
dependencies = { 'prabirshrestha/async.vim' },
|
||||
config = function()
|
||||
end
|
||||
}
|
||||
|
||||
--[[
|
||||
--Create a .vim-arsync file on the root of your project that contains the following:
|
||||
remote_host example.com
|
||||
remote_user john
|
||||
remote_port 22
|
||||
remote_passwd secret
|
||||
remote_path ~/temp/
|
||||
local_path /home/ken/temp/vuetest/
|
||||
ignore_path ["build/","test/"]
|
||||
ignore_dotfiles 1
|
||||
auto_sync_up 0
|
||||
remote_or_local remote
|
||||
sleep_before_sync 0
|
||||
|
||||
--]]
|
||||
64
.config/nvim/settings.vim
Normal file
64
.config/nvim/settings.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
set nocompatible
|
||||
syntax on
|
||||
filetype plugin on
|
||||
set autoread " Set to auto read when a file is changed from the outside
|
||||
|
||||
set path+=**
|
||||
set wildmenu
|
||||
set showcmd
|
||||
set wildmode=longest:full,full
|
||||
set wildoptions=pum
|
||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
|
||||
set wildignore+=*\\tmp\\*,*.exe
|
||||
|
||||
set number
|
||||
set number ruler
|
||||
set showmatch
|
||||
set ruler
|
||||
set wrap
|
||||
set showbreak=↳\ \
|
||||
set textwidth=79
|
||||
set hidden
|
||||
set backspace=indent,eol,start
|
||||
set hlsearch
|
||||
set noswapfile
|
||||
|
||||
" Rendering
|
||||
set ttyfast
|
||||
set laststatus=1
|
||||
set t_Co=256
|
||||
set background=dark
|
||||
|
||||
set colorcolumn=81
|
||||
hi ColorColumn ctermbg=lightgrey guibg=lightgrey
|
||||
|
||||
" Show bad whitespace in an obvious but not obnoxious color
|
||||
highlight pythonSpaceError ctermbg=darkgreen guibg=darkgreen
|
||||
highlight BadWhitespace ctermbg=darkgreen guibg=darkgreen
|
||||
au BufNewFile,BufRead *.py,*.pyw,*.c,*.h,*.cc,*.hh,*.sh match BadWhitespace /\s\+$/
|
||||
|
||||
" File settings
|
||||
au FileType *
|
||||
\ set tabstop=2
|
||||
\ softtabstop=2
|
||||
\ shiftwidth=2
|
||||
\ textwidth=79
|
||||
\ autoindent
|
||||
\ smartindent
|
||||
|
||||
"Python Specific Config
|
||||
au FileType python
|
||||
\ set fileformat=unix
|
||||
\ tabstop=4
|
||||
\ softtabstop=4
|
||||
\ shiftwidth=4
|
||||
\ encoding=utf-8
|
||||
\ makeprg=flake8\ %
|
||||
|
||||
au FileType markdown
|
||||
\ set spell spelllang=en_us
|
||||
\ tabstop=4
|
||||
\ softtabstop=4
|
||||
\ shiftwidth=4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user