reorg vim config
This commit is contained in:
parent
1105e45c4b
commit
ff6a06497f
1
config/nvim/.config/nvim/after/ftplugin/lua.vim
Normal file
1
config/nvim/.config/nvim/after/ftplugin/lua.vim
Normal file
@ -0,0 +1 @@
|
|||||||
|
set sw=2 ts=2
|
||||||
@ -1,27 +1,10 @@
|
|||||||
-- init.lua --
|
-- init.lua --
|
||||||
|
|
||||||
-- general vim settings
|
-- general vim settings
|
||||||
require('settings')
|
require('config.settings') -- general vim settings
|
||||||
|
require('config.keymaps') -- general vim keymaps
|
||||||
-- vim keymaps
|
require('config.plugins') -- loads plugins (packer)
|
||||||
require('keymaps')
|
require('config.platform_specific') -- platform specific settings (Win32, Mac, Linux)
|
||||||
|
|
||||||
-- package manager (packer.nvim)
|
|
||||||
require('plugins')
|
|
||||||
|
|
||||||
-- plugin configurations
|
-- plugin configurations
|
||||||
require('plugin-config')
|
require('plugin-config')
|
||||||
|
|
||||||
-- platform/os specific stuff
|
|
||||||
if vim.fn.has('win32') then
|
|
||||||
vim.cmd([[
|
|
||||||
" WSL yank support
|
|
||||||
let s:clip = '/mnt/c/Windows/System32/clip.exe' " change this path according to your mount point
|
|
||||||
if executable(s:clip)
|
|
||||||
augroup WSLYank
|
|
||||||
autocmd!
|
|
||||||
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
|
|
||||||
augroup END
|
|
||||||
endif
|
|
||||||
]])
|
|
||||||
end
|
|
||||||
|
|||||||
13
config/nvim/.config/nvim/lua/config/platform_specific.lua
Normal file
13
config/nvim/.config/nvim/lua/config/platform_specific.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
-- platform/os specific stuff
|
||||||
|
if vim.fn.has('win32') then
|
||||||
|
vim.cmd([[
|
||||||
|
" WSL yank support
|
||||||
|
let s:clip = '/mnt/c/Windows/System32/clip.exe' " change this path according to your mount point
|
||||||
|
if executable(s:clip)
|
||||||
|
augroup WSLYank
|
||||||
|
autocmd!
|
||||||
|
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
]])
|
||||||
|
end
|
||||||
@ -69,11 +69,7 @@ require('packer').startup(function(use)
|
|||||||
use { 'junegunn/fzf.vim' }
|
use { 'junegunn/fzf.vim' }
|
||||||
|
|
||||||
-- colorschemes
|
-- colorschemes
|
||||||
use({
|
-- use 'rose-pine/neovim'
|
||||||
'rose-pine/neovim',
|
use 'w0ng/vim-hybrid'
|
||||||
as = 'rose-pine',
|
|
||||||
config = function()
|
|
||||||
vim.cmd('colorscheme rose-pine')
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end)
|
end)
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
local ok, _ = pcall(vim.cmd, 'colorscheme hybrid')
|
||||||
|
if not ok then
|
||||||
|
vim.cmd 'colorscheme delek' -- if the above fails, then use default
|
||||||
|
end
|
||||||
@ -1,21 +1,25 @@
|
|||||||
-- plugin-config/init.lua
|
-- plugin-config/init.lua
|
||||||
|
|
||||||
|
-- * LSP, Completion and TreeSitter * --
|
||||||
-- lsp
|
-- lsp
|
||||||
require('plugin-config.lsp')
|
require('plugin-config.lsp')
|
||||||
|
|
||||||
-- completion
|
-- completion
|
||||||
require('plugin-config.cmp')
|
require('plugin-config.cmp')
|
||||||
|
-- treesitter (tree based syntax highlighting)
|
||||||
-- treesitter (syntax highlighting)
|
|
||||||
require('plugin-config.nvim-treesitter')
|
require('plugin-config.nvim-treesitter')
|
||||||
|
|
||||||
|
-- * File explorer and Fuzzy Finder * --
|
||||||
-- nvim-tree
|
-- nvim-tree
|
||||||
require('plugin-config.nvim-tree')
|
require('plugin-config.nvim-tree')
|
||||||
|
-- fzf (fuzzy finder)
|
||||||
|
require('plugin-config.fzf')
|
||||||
|
|
||||||
|
-- * Git Integration * --
|
||||||
-- gitsigns
|
-- gitsigns
|
||||||
require('plugin-config.gitsigns')
|
require('plugin-config.gitsigns')
|
||||||
|
-- vim-fugitive (git plugin)
|
||||||
|
require('plugin-config.vim-fugitive')
|
||||||
|
|
||||||
-- plugin keybinds
|
|
||||||
require('plugin-config.keybinds.vim-fugitive')
|
-- colorscheme
|
||||||
require('plugin-config.keybinds.fzf')
|
require('plugin-config.colorscheme')
|
||||||
require('plugin-config.keybinds.nvim-tree')
|
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
-- NvimTree
|
|
||||||
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<cr>')
|
|
||||||
@ -1 +1,3 @@
|
|||||||
|
-- NvimTree
|
||||||
require('nvim-tree').setup()
|
require('nvim-tree').setup()
|
||||||
|
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<cr>')
|
||||||
|
|||||||
@ -4,10 +4,10 @@ require('nvim-treesitter.configs').setup {
|
|||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help' },
|
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help' },
|
||||||
|
|
||||||
highlight = { enable = true },
|
highlight = { enable = false },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = false,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
init_selection = '<c-space>',
|
init_selection = '<c-space>',
|
||||||
node_incremental = '<c-space>',
|
node_incremental = '<c-space>',
|
||||||
@ -60,3 +60,5 @@ require('nvim-treesitter.configs').setup {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>td', 'TSDisable highlight')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user