reorg vim config

This commit is contained in:
James Dixon 2023-01-03 16:04:19 -05:00
parent 1105e45c4b
commit ff6a06497f
13 changed files with 42 additions and 39 deletions

View File

@ -0,0 +1 @@
set sw=2 ts=2

View File

@ -1,27 +1,10 @@
-- init.lua --
-- general vim settings
require('settings')
-- vim keymaps
require('keymaps')
-- package manager (packer.nvim)
require('plugins')
require('config.settings') -- general vim settings
require('config.keymaps') -- general vim keymaps
require('config.plugins') -- loads plugins (packer)
require('config.platform_specific') -- platform specific settings (Win32, Mac, Linux)
-- plugin configurations
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

View 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

View File

@ -69,11 +69,7 @@ require('packer').startup(function(use)
use { 'junegunn/fzf.vim' }
-- colorschemes
use({
'rose-pine/neovim',
as = 'rose-pine',
config = function()
vim.cmd('colorscheme rose-pine')
end
})
-- use 'rose-pine/neovim'
use 'w0ng/vim-hybrid'
end)

View File

@ -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

View File

@ -1,21 +1,25 @@
-- plugin-config/init.lua
-- * LSP, Completion and TreeSitter * --
-- lsp
require('plugin-config.lsp')
-- completion
require('plugin-config.cmp')
-- treesitter (syntax highlighting)
-- treesitter (tree based syntax highlighting)
require('plugin-config.nvim-treesitter')
-- * File explorer and Fuzzy Finder * --
-- nvim-tree
require('plugin-config.nvim-tree')
-- fzf (fuzzy finder)
require('plugin-config.fzf')
-- * Git Integration * --
-- gitsigns
require('plugin-config.gitsigns')
-- vim-fugitive (git plugin)
require('plugin-config.vim-fugitive')
-- plugin keybinds
require('plugin-config.keybinds.vim-fugitive')
require('plugin-config.keybinds.fzf')
require('plugin-config.keybinds.nvim-tree')
-- colorscheme
require('plugin-config.colorscheme')

View File

@ -1,2 +0,0 @@
-- NvimTree
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<cr>')

View File

@ -1 +1,3 @@
-- NvimTree
require('nvim-tree').setup()
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<cr>')

View File

@ -4,10 +4,10 @@ require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help' },
highlight = { enable = true },
highlight = { enable = false },
indent = { enable = true },
incremental_selection = {
enable = true,
enable = false,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
@ -60,3 +60,5 @@ require('nvim-treesitter.configs').setup {
},
},
}
vim.keymap.set('n', '<leader>td', 'TSDisable highlight')