add start.lua, regression changes to init.vim

This commit is contained in:
mightypanders 2022-08-23 16:08:51 +02:00
parent 6f4157bb43
commit 5b4a9e26f5
2 changed files with 139 additions and 3 deletions

View File

@ -26,6 +26,9 @@ set mouse=nicr
set termguicolors set termguicolors
call plug#begin(stdpath('data') . '/plugged') call plug#begin(stdpath('data') . '/plugged')
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'junegunn/vim-easy-align' Plug 'junegunn/vim-easy-align'
Plug 'morhetz/gruvbox' Plug 'morhetz/gruvbox'
Plug 'junegunn/fzf', {'do': {->fzf#install()}} Plug 'junegunn/fzf', {'do': {->fzf#install()}}
@ -65,13 +68,13 @@ set termguicolors
set completeopt=menuone,noselect set completeopt=menuone,noselect
highlight NvimTreeFolderIcon guibg=blue
lua require('nvimtree') lua require('nvimtree')
lua require('lsp_config') lua require('lsp_conf')
lua require('treesitter_config') lua require('treesitter_config')
lua require('dap_config') lua require('dap_config')
lua require('jester') lua require('jester')
lua require('mason_config')
lua require'fzf_lsp'.setup()
"Leader "Leader
nnoremap <SPACE> <Nop> nnoremap <SPACE> <Nop>

133
nvim/start.lua Normal file
View File

@ -0,0 +1,133 @@
local set = vim.opt
set.modelines=0
set.hidden=true
set.number=true
set.ruler=true
set.visualbell=true
set.textwidth=120
set.cursorline=true
set.tabstop=2
set.shiftwidth=2
set.showmode=true
set.showcmd=true
set.showmatch=true
set.hlsearch=true
set.ignorecase=true
set.smartcase=true
set.incsearch=true
set.wrapscan=true
set.scrolloff=999
set.backspace="indent,eol,start"
set.mouse="nicr"
set.termguicolors=true
set.matchpairs:append("<:>")
set.completeopt="menuone,noselect,preview"
vim.cmd("hi CursorLine term=bold cterm=bold ctermbg=darkgrey")
require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"WhoIsSethDaniel/mason-tool-installer.nvim"
}
use 'mfussenegger/nvim-dap'
use 'jose-elias-alvarez/null-ls.nvim'
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'nvim-lua/lsp-status.nvim'
use 'jiangmiao/auto-pairs'
use 'machakann/vim-sandwich'
use 'machakann/vim-highlightedyank'
use 'bling/vim-airline'
use 'airblade/vim-gitgutter'
use 'easymotion/vim-easymotion'
use {
'antoinemadec/FixCursorHold.nvim',
'kosayoda/nvim-lightbulb'
}
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-cmdline'
use 'saadparwaiz1/cmp_luasnip'
use 'L3MON4D3/LuaSnip'
use 'kyazdani42/nvim-web-devicons'
use 'kyazdani42/nvim-tree.lua'
use 'tpope/vim-fugitive'
use {
'nvim-treesitter/nvim-treesitter',
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
}
use 'folke/tokyonight.nvim'
use 'simrat39/rust-tools.nvim'
--use 'morhetz/gruvbox'
end)
vim.cmd[[colorscheme tokyonight]]
--- Treesitter
---BEGINWORKAROUND
--vim.api.nvim_create_autocmd({'BufEnter','BufAdd','BufNew','BufNewFile','BufWinEnter'}, {
-- group = vim.api.nvim_create_augroup('TS_FOLD_WORKAROUND', {}),
-- callback = function()
-- vim.opt.foldmethod = 'expr'
-- vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
-- end
--})
---ENDWORKAROUND
--- Treesitter
--- Utility functions
function map(mode, shortcut, command)
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
end
function nmap(shortcut, command)
map('n', shortcut, command)
end
function imap(shortcut, command)
map('i', shortcut, command)
end
function xmap(shortcut, command)
map('x', shortcut, command)
end
---
require('nvim-lightbulb_config')
require('nvimtree')
require('treesitter_config')
require('dap_config')
require('mason_config')
require('new_lsp_conf')
require('cmp_config')
require("null-ls").setup({
sources = {
require("null-ls").builtins.formatting.stylua,
require("null-ls").builtins.diagnostics.eslint,
require("null-ls").builtins.completion.spell,
},
})
vim.cmd([[
runtime macros/sandwich/keymap/surround.vim
]])
nmap("<SPACE>","<Nop>")
vim.g.mapleader = " "
xmap("p",'\"_dP')
nmap("<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>")
nmap("<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>")
nmap("<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>")
nmap("<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<cr>")
nmap("<C-n>",":NvimTreeToggle<cr>")
nmap("<leader>r",":NvimTreeRefresh<cr>")
nmap("<leader>n",":NvimTreeToggle<cr>")