Initial commit

This commit is contained in:
2024-01-28 14:26:18 -06:00
commit 9b6eca40d5
27 changed files with 1167 additions and 0 deletions

11
laptop/nvim/init.lua Normal file
View File

@@ -0,0 +1,11 @@
require('config/keymaps')
require('config/settings')
require('config/plugins')
require('config/plugins/coc')
require('config/plugins/lualine')
require('config/plugins/ale')
require('config/plugins/nerdtree')
local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/"
vim.cmd('source' .. vimscriptpath .. 'init.vim')

View File

@@ -0,0 +1,6 @@
vim.g.mapleader=','
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-l>', '<C-w>l')

View File

@@ -0,0 +1 @@
vim.g['ale_linters']={ ['cs'] = 'OmniSharp' }

View File

@@ -0,0 +1 @@
vim.g['AutoPairsFlyMode']=0

View File

@@ -0,0 +1,10 @@
local keyset = vim.keymap.set
function _G.check_back_space()
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end
local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)

View File

@@ -0,0 +1,35 @@
local plugins = {
'nvim-lualine/lualine.nvim',
'kyazdani42/nvim-web-devicons',
{'neoclide/coc.nvim',
branch = 'release'},
'navarasu/onedark.nvim',
'tpope/vim-surround',
'godlygeek/tabular',
'OmniSharp/omnisharp-vim',
'dense-analysis/ale',
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
opts={},
},
'preservim/nerdtree',
'junegunn/fzf.vim',
'junegunn/fzf',
'rust-lang/rust.vim'
}
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, opts)

View File

@@ -0,0 +1,36 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'wombat',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = true,
},
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 = {
lualine_a = {'buffers'},
lualine_b = {'branch'},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {},
lualine_z = {'tabs'}
},
extensions = {}
}

View File

@@ -0,0 +1,6 @@
vim.keymap.set('n', '<leader>nt', ':NERDTreeToggle<CR>')
vim.cmd[[
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
]]

View File

@@ -0,0 +1,37 @@
vim.opt.cursorline=true
vim.opt.relativenumber=true
vim.opt.number=true
vim.opt.scrolloff=10
vim.opt.autoindent=true
vim.opt.expandtab=true
vim.opt.softtabstop=4
vim.opt.shiftwidth=4
vim.opt.shiftround=true
vim.opt.backspace={'indent','eol','start'}
vim.opt.hidden=true
vim.opt.laststatus=2
vim.opt.display='lastline'
vim.opt.showmode=true
vim.opt.showcmd=true
vim.opt.incsearch=true
vim.opt.ignorecase=true
vim.opt.smartcase=true
vim.opt.ttyfast=true
vim.opt.updatetime=300
vim.opt.splitright=true
vim.opt.wrapscan=true
vim.opt.report=0
vim.opt.list=true
vim.g['loaded_perl_provider']=0
vim.g['python3_host_prog']='/usr/bin/python'

View File

@@ -0,0 +1,8 @@
filetype plugin indent on
syntax on
colorscheme onedark
if has('multi_byte') && &encoding ==# 'utf-8'
let &listchars = 'tab:▸ ,extends:,precedes:,nbsp:±'
else
let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.'
endif