From 604189e7d6d9c0173c2067c47c23a7091f1649df Mon Sep 17 00:00:00 2001 From: David Holland Date: Sat, 15 Jul 2023 18:52:38 +0200 Subject: [PATCH] Cleanup vim for primary emacs usage --- custom.vim.example | 4 --- lua/.gitignore | 15 +++++++++++ lua/custom/.gitignore | 6 +++++ lua/platform/.gitignore | 6 +++++ lua/plugins.lua | 21 +++++++++++++++ lua/settings.lua | 49 ++++++++++++++--------------------- pack/packer/start/packer.nvim | 1 - platform.vim.example | 3 --- 8 files changed, 68 insertions(+), 37 deletions(-) delete mode 100644 custom.vim.example create mode 100644 lua/.gitignore create mode 100644 lua/custom/.gitignore create mode 100644 lua/platform/.gitignore delete mode 160000 pack/packer/start/packer.nvim delete mode 100644 platform.vim.example diff --git a/custom.vim.example b/custom.vim.example deleted file mode 100644 index bf47022..0000000 --- a/custom.vim.example +++ /dev/null @@ -1,4 +0,0 @@ -"Here you can define your own custom settings like -"let g:use_sound = 1 -"let g:use_autocomplete = 1 -"let g:use_coc = 1 diff --git a/lua/.gitignore b/lua/.gitignore new file mode 100644 index 0000000..34d45bd --- /dev/null +++ b/lua/.gitignore @@ -0,0 +1,15 @@ +/* +/*/ +!/.gitignore +!/.gitattributes + +!/keymaps.lua +!/plugin_options.lua +!/plugins.lua +!/post_plugins.lua +!/pre_plugins.lua +!/settings.lua +!/utilities.lua + +!/custom/ +!/platform/ diff --git a/lua/custom/.gitignore b/lua/custom/.gitignore new file mode 100644 index 0000000..fdbc78f --- /dev/null +++ b/lua/custom/.gitignore @@ -0,0 +1,6 @@ +/* +/*/ +!/.gitignore +!/.gitattributes + +!/example.lua diff --git a/lua/platform/.gitignore b/lua/platform/.gitignore new file mode 100644 index 0000000..fdbc78f --- /dev/null +++ b/lua/platform/.gitignore @@ -0,0 +1,6 @@ +/* +/*/ +!/.gitignore +!/.gitattributes + +!/example.lua diff --git a/lua/plugins.lua b/lua/plugins.lua index a347a16..593b296 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -4,6 +4,19 @@ vim.api.nvim_create_autocmd('BufWritePost', { command = 'source | PackerCompile', }) +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + return require('packer').startup(function(use) -- Packer can manage itself use { @@ -499,4 +512,12 @@ return require('packer').startup(function(use) use 'chriskempson/base16-vim' end -- === + + -- === + -- Auto :PackerSync + -- === + -- if packer_bootstrap then + -- require('packer').sync() + -- end + -- === end) diff --git a/lua/settings.lua b/lua/settings.lua index daca677..0cefe04 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -2,7 +2,7 @@ HOME = os.getenv("HOME") vim.opt.compatible = false -if string.match(vim.opt.shell["_value"], 'fish$') then +if string.match(vim.opt.shell["_value"], 'fish$') or string.match(vim.opt.shell["_value"], 'nu$') then if vim.fn.executable('zsh') then vim.opt.shell = "zsh" vim.g.replacement_shell = "zsh" @@ -36,20 +36,11 @@ if vim.g.platform == "linux" then vim.opt.termguicolors = true else vim.opt.termguicolors = false - - --vim.api.nvim_create_autocmd('ColorScheme', { - --pattern = 'themer_dracula', - --command = 'hi Visual cterm=reverse', - --}) end elseif vim.g.platform == "xterm" then vim.opt.termguicolors = false vim.opt.guicursor = "" vim.opt.t_Co = "" - --vim.api.nvim_create_autocmd('ColorScheme', { - --pattern = 'themer_dracula', - --command = 'hi Visual cterm=reverse', - --}) else vim.opt.termguicolors = true end @@ -115,7 +106,7 @@ vim.opt.linebreak = true vim.opt.list = true vim.opt.listchars = { trail = "·", tab = "•\\", extends = "⟩", precedes = "⟨" } vim.opt.number = true -vim.opt.relativenumber = true +vim.opt.relativenumber = false -- set this to true, if switching is used vim.opt.scrolloff = 1 vim.opt.shiftwidth = 4 vim.opt.shortmess = "a" @@ -142,10 +133,10 @@ local config = { tex_items = "", use_airline = false, - use_alt_colorschemes = true, - use_arm_syntax = true, - use_asciidoctor = true, - use_asm_indent = true, + use_alt_colorschemes = false, + use_arm_syntax = false, + use_asciidoctor = false, + use_asm_indent = false, use_async = true, use_autocomplete = 0, use_bufkill = true, @@ -153,12 +144,12 @@ local config = { use_clang_format = false, use_coc = false, use_comfortable_motion = false, - use_cpp = true, + use_cpp = false, use_fish = true, use_font = false, use_fswitch = true, use_fugitive = true, - use_gas = true, + use_gas = false, use_indentguides = false, use_javacomplete = false, use_latexmk = false, @@ -242,18 +233,18 @@ vim.api.nvim_create_autocmd('FileType', { -- === -- Don't schow relative numbers in insert mode, but show them in normal mode -- === -vim.api.nvim_create_autocmd({'BufWinEnter', 'BufEnter', 'FocusGained', 'InsertLeave' }, { - pattern = '*', - callback = function() - vim.opt.relativenumber = true - end, -}) -vim.api.nvim_create_autocmd({'BufWinLeave', 'BufLeave', 'FocusLost', 'InsertEnter' }, { - pattern = '*', - callback = function() - vim.opt.relativenumber = false - end, -}) +-- vim.api.nvim_create_autocmd({'BufWinEnter', 'BufEnter', 'FocusGained', 'InsertLeave' }, { +-- pattern = '*', +-- callback = function() +-- vim.opt.relativenumber = true +-- end, +-- }) +-- vim.api.nvim_create_autocmd({'BufWinLeave', 'BufLeave', 'FocusLost', 'InsertEnter' }, { +-- pattern = '*', +-- callback = function() +-- vim.opt.relativenumber = false +-- end, +-- }) -- === -- vim.cmd("hi LineNr guifg=#B0BEC5") diff --git a/pack/packer/start/packer.nvim b/pack/packer/start/packer.nvim deleted file mode 160000 index 4dedd3b..0000000 --- a/pack/packer/start/packer.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dedd3b08f8c6e3f84afbce0c23b66320cd2a8f2 diff --git a/platform.vim.example b/platform.vim.example deleted file mode 100644 index 34037b1..0000000 --- a/platform.vim.example +++ /dev/null @@ -1,3 +0,0 @@ -" Possible options: windows, windows_portable, linux, termux, linux_qt, arch -" Note that linux_qt and arch have not been implemented yet -let g:platform = "windows_portable"