Compare commits
23 Commits
0b27a36349
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b005087bc | |||
| cc8e47ea5d | |||
| 46420f641e | |||
| 33d89b9d15 | |||
| ba7f1b0c00 | |||
| 4d99747372 | |||
| 84f0d9e43d | |||
| 057cd602f2 | |||
| 0323f72b9d | |||
| 10fd023f56 | |||
| ce6330707c | |||
| 73f6d4ae58 | |||
| 3ac339633a | |||
| 8934927e9d | |||
| c35d7b01f7 | |||
| 989755a978 | |||
| 8f0dbb31f2 | |||
| 540c90f669 | |||
| 1021617068 | |||
| c4e98d0f18 | |||
| 778ed542a6 | |||
| cb4c40af43 | |||
| 579ef3c118 |
@@ -1,3 +1,4 @@
|
|||||||
|
.stfolder
|
||||||
Downloads
|
Downloads
|
||||||
__pycache__
|
__pycache__
|
||||||
Win
|
Win
|
||||||
|
|||||||
@@ -0,0 +1,512 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Modern Neovim Configuration (lazy.nvim)
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
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",
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Plugin Specifications
|
||||||
|
-- ============================================================================
|
||||||
|
require("lazy").setup({
|
||||||
|
-- File tree
|
||||||
|
{
|
||||||
|
'scrooloose/nerdtree',
|
||||||
|
cmd = 'NERDTreeToggle',
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Build/async tools
|
||||||
|
'tpope/vim-dispatch',
|
||||||
|
|
||||||
|
-- Git integration
|
||||||
|
'tpope/vim-fugitive',
|
||||||
|
|
||||||
|
-- Text manipulation
|
||||||
|
'tpope/vim-abolish',
|
||||||
|
|
||||||
|
-- Large file handling
|
||||||
|
{
|
||||||
|
'LunarVim/bigfile.nvim',
|
||||||
|
config = function()
|
||||||
|
require('bigfile').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- FZF
|
||||||
|
{ 'junegunn/fzf' },
|
||||||
|
{
|
||||||
|
'ibhagwan/fzf-lua',
|
||||||
|
branch = 'main',
|
||||||
|
config = function()
|
||||||
|
require('fzf-lua').setup({
|
||||||
|
winopts = {
|
||||||
|
height = 0.95,
|
||||||
|
width = 0.95
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
|
||||||
|
-- Alignment
|
||||||
|
{
|
||||||
|
'junegunn/vim-easy-align',
|
||||||
|
init = function()
|
||||||
|
vim.g.easy_align_delimiters = {
|
||||||
|
['>'] = { pattern = '>>\\|=>\\|>' },
|
||||||
|
['/'] = {
|
||||||
|
pattern = '//\\+\\|/\\*\\|\\*/',
|
||||||
|
delimiter_align = 'l',
|
||||||
|
ignore_groups = {'!Comment'}
|
||||||
|
},
|
||||||
|
[']'] = {
|
||||||
|
pattern = '[[\\]]',
|
||||||
|
left_margin = 0,
|
||||||
|
right_margin = 0,
|
||||||
|
stick_to_left = 0
|
||||||
|
},
|
||||||
|
[')'] = {
|
||||||
|
pattern = '[)]',
|
||||||
|
left_margin = 0,
|
||||||
|
right_margin = 0,
|
||||||
|
stick_to_left = 0
|
||||||
|
},
|
||||||
|
['('] = {
|
||||||
|
pattern = '[(]',
|
||||||
|
left_margin = 0,
|
||||||
|
right_margin = 0,
|
||||||
|
stick_to_left = 0
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File picker
|
||||||
|
{
|
||||||
|
'dmtrKovalenko/fff.nvim',
|
||||||
|
build = function()
|
||||||
|
-- this will download prebuild binary or try to use existing rustup toolchain to build from source
|
||||||
|
-- (if you are using lazy you can use gb for rebuilding a plugin if needed)
|
||||||
|
require("fff.download").download_or_build_binary()
|
||||||
|
end,
|
||||||
|
-- No need to lazy-load with lazy.nvim.
|
||||||
|
-- This plugin initializes itself lazily.
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>f",
|
||||||
|
function() require('fff').find_files() end,
|
||||||
|
desc = 'FFFind files',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>r",
|
||||||
|
function() require('fff').live_grep() end,
|
||||||
|
desc = 'LiFFFe grep',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>R",
|
||||||
|
function() require('fff').live_grep({ query = vim.fn.expand("<cword>") }) end,
|
||||||
|
desc = 'Search current word',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- C++ syntax highlighting
|
||||||
|
{
|
||||||
|
'bfrg/vim-cpp-modern',
|
||||||
|
init = function()
|
||||||
|
vim.g.cpp_function_highlight = 1
|
||||||
|
vim.g.cpp_attributes_highlight = 1
|
||||||
|
vim.g.cpp_member_highlight = 0
|
||||||
|
vim.g.cpp_simple_highlight = 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Motion
|
||||||
|
{
|
||||||
|
url = 'https://codeberg.org/andyg/leap.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set({'n', 'x', 'o'}, '<tab>', '<Plug>(leap)')
|
||||||
|
vim.keymap.set({'n', 'x', 'o'}, '<S-tab>', '<Plug>(leap-from-window)')
|
||||||
|
-- Highly recommended: define a preview filter to reduce visual noise
|
||||||
|
-- and the blinking effect after the first keypress
|
||||||
|
-- (see `:h leap.opts.preview`).
|
||||||
|
-- For example, skip preview if the first character of the match is
|
||||||
|
-- whitespace or is in the middle of an alphabetic word:
|
||||||
|
require('leap').opts.preview = function(ch0, ch1, ch2)
|
||||||
|
return not (
|
||||||
|
ch1:match('%s')
|
||||||
|
or (ch0:match('%a') and ch1:match('%a') and ch2:match('%a'))
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Define equivalence classes for brackets and quotes, in addition to
|
||||||
|
-- the default whitespace group:
|
||||||
|
require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' }
|
||||||
|
|
||||||
|
-- Use the traversal keys to repeat the previous motion without
|
||||||
|
-- explicitly invoking Leap:
|
||||||
|
require('leap.user').set_repeat_keys('<enter>', '<backspace>')
|
||||||
|
|
||||||
|
-- Automatic paste after remote yank operations:
|
||||||
|
vim.api.nvim_create_autocmd('User', {
|
||||||
|
pattern = 'RemoteOperationDone',
|
||||||
|
group = vim.api.nvim_create_augroup('LeapRemote', {}),
|
||||||
|
callback = function(event)
|
||||||
|
if vim.v.operator == 'y' and event.data.register == '"' then
|
||||||
|
vim.cmd('normal! p')
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Theme
|
||||||
|
{
|
||||||
|
'sainnhe/gruvbox-material',
|
||||||
|
priority = 1000,
|
||||||
|
init = function()
|
||||||
|
vim.g.gruvbox_material_background = 'hard'
|
||||||
|
vim.g.gruvbox_material_foreground = 'mix'
|
||||||
|
vim.g.gruvbox_material_disable_italic_comment = 1
|
||||||
|
vim.g.gruvbox_material_enable_italic = 0
|
||||||
|
vim.g.gruvbox_material_enable_bold = 0
|
||||||
|
vim.g.gruvbox_material_diagnostic_virtual_text = 'colored'
|
||||||
|
vim.g.gruvbox_material_better_performance = 1
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
vim.cmd('colorscheme gruvbox-material')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Odin syntax
|
||||||
|
'Tetralux/odin.vim',
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
config = function()
|
||||||
|
require('mason').setup({})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
config = function()
|
||||||
|
require('mason-lspconfig').setup({
|
||||||
|
ensure_installed = { "clangd" },
|
||||||
|
automatic_enable = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
|
||||||
|
-- Completion
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require('cmp')
|
||||||
|
cmp.setup({
|
||||||
|
sources = {
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = 'path' },
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||||
|
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
|
||||||
|
-- Utilities
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
|
||||||
|
-- Opencode
|
||||||
|
{
|
||||||
|
"sudo-tee/opencode.nvim",
|
||||||
|
config = function()
|
||||||
|
require("opencode").setup({})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
opts = {
|
||||||
|
anti_conceal = { enabled = false },
|
||||||
|
file_types = { 'markdown', 'opencode_output' },
|
||||||
|
},
|
||||||
|
ft = { 'markdown', 'Avante', 'copilot-chat', 'opencode_output' },
|
||||||
|
},
|
||||||
|
-- Optional, for file mentions and commands completion, pick only one
|
||||||
|
-- 'saghen/blink.cmp',
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
|
||||||
|
-- Optional, for file mentions picker, pick only one
|
||||||
|
-- 'folke/snacks.nvim',
|
||||||
|
-- 'nvim-telescope/telescope.nvim',
|
||||||
|
-- 'ibhagwan/fzf-lua',
|
||||||
|
-- 'nvim_mini/mini.nvim',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
install = {
|
||||||
|
colorscheme = { "gruvbox-material" },
|
||||||
|
},
|
||||||
|
checker = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Options
|
||||||
|
-- ============================================================================
|
||||||
|
vim.opt.autowrite = true
|
||||||
|
vim.opt.colorcolumn = { 80, 100 }
|
||||||
|
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||||
|
vim.opt.cpoptions:append('$')
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.guifont = 'JetBrains_Mono,Consolas:h9'
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.linebreak = true
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars:append('tab:>-,trail:■,extends:»,precedes:«')
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.textwidth = 80
|
||||||
|
vim.opt.visualbell = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.signcolumn = 'no'
|
||||||
|
|
||||||
|
-- Setup undo and backup directories
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.undodir = vim.fn.stdpath('config') .. '/undo'
|
||||||
|
vim.opt.backupdir = vim.fn.stdpath('config') .. '/backup'
|
||||||
|
|
||||||
|
-- Status line
|
||||||
|
vim.opt.statusline = '%<%F%h%m%r [%{&ff}] (%{strftime("%H:%M %d/%m/%Y",getftime(expand("%:p")))})%=%l,%c%V %P'
|
||||||
|
|
||||||
|
-- Wild ignore
|
||||||
|
vim.opt.wildignore:append('*.class,*.o,*\\tmp\\*,*.swp,*.zip,*.exe,*.obj,*.vcxproj,*.pdb,*.idb')
|
||||||
|
|
||||||
|
-- Mouse support
|
||||||
|
vim.opt.mouse = 'a'
|
||||||
|
|
||||||
|
-- Spelling
|
||||||
|
vim.opt.spell = true
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- LSP Configuration
|
||||||
|
-- ============================================================================
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
vim.keymap.set("n", "<F2>", vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set("n", "<F4>", vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||||
|
|
||||||
|
-- Diagnostic configuration
|
||||||
|
vim.diagnostic.config({
|
||||||
|
signs = false,
|
||||||
|
virtual_text = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Spelling highlight
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("highlight SpellBad gui=underline guifg=#d3869b")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Vim Dispatch Configuration
|
||||||
|
-- ============================================================================
|
||||||
|
if vim.fn.has('win64') == 1 or vim.fn.has('win32') == 1 or vim.fn.has('win16') == 1 then
|
||||||
|
if os.getenv('SHELL') ~= nil then
|
||||||
|
vim.o.shellcmdflag = '-c'
|
||||||
|
vim.o.makeprg = "./build.sh"
|
||||||
|
else
|
||||||
|
vim.o.makeprg = "build.bat"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
vim.o.makeprg = "./build.sh"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Autocommands
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
-- Automatically scroll to bottom of quickfix window when opened
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "qf",
|
||||||
|
callback = function()
|
||||||
|
vim.cmd('normal! G')
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Per-Project Bindings - load project file on buffer enter
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
callback = function()
|
||||||
|
local project_file = vim.fn.getcwd() .. '/project_nvim.lua'
|
||||||
|
if vim.fn.filereadable(project_file) == 1 then
|
||||||
|
vim.cmd('luafile ' .. vim.fn.fnameescape(project_file))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Formatting options
|
||||||
|
vim.api.nvim_create_augroup("persistent_settings", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
group = "persistent_settings",
|
||||||
|
pattern = "*",
|
||||||
|
command = "set formatoptions=q1j",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Functions
|
||||||
|
-- ============================================================================
|
||||||
|
local function raddbg_open_file()
|
||||||
|
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
|
||||||
|
vim.fn.system("dev raddbg --ipc open " .. filepath)
|
||||||
|
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
|
||||||
|
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function raddbg_start_debugging()
|
||||||
|
vim.fn.system("dev raddbg --ipc run")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function raddbg_stop_debugging()
|
||||||
|
vim.fn.system("dev raddbg --ipc kill_all")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function raddbg_run_to_cursor()
|
||||||
|
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
|
||||||
|
vim.fn.system("dev raddbg --ipc open " .. filepath)
|
||||||
|
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
|
||||||
|
vim.fn.system("dev raddbg --ipc run_to_cursor " .. filepath .. ":" .. vim.fn.line("."))
|
||||||
|
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function raddbg_add_breakpoint()
|
||||||
|
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
|
||||||
|
vim.fn.system("dev raddbg --ipc open " .. filepath)
|
||||||
|
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
|
||||||
|
vim.fn.system("dev raddbg --ipc toggle_breakpoint " .. filepath .. ":" .. vim.fn.line("."))
|
||||||
|
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Keymaps
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
local function adjust_fontsize(amount)
|
||||||
|
-- Get current font and size
|
||||||
|
local current_font = vim.opt.guifont:get()[1] or "Consolas"
|
||||||
|
local current_size = tonumber(current_font:match(":h(%d+)")) or 12
|
||||||
|
|
||||||
|
-- Extract font name (everything before :h)
|
||||||
|
local font_name = current_font:match("^(.+):h%d+") or current_font
|
||||||
|
|
||||||
|
-- Calculate new size
|
||||||
|
local new_size = math.max(6, current_size + amount) -- Minimum size of 6
|
||||||
|
|
||||||
|
-- Apply new font setting
|
||||||
|
if vim.g.neovide then
|
||||||
|
vim.opt.guifont = font_name .. ":h" .. new_size
|
||||||
|
else
|
||||||
|
vim.cmd("GuiFont! " .. font_name .. ":h" .. new_size)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Numpad mappings
|
||||||
|
vim.keymap.set('n', '<C-=>', function() adjust_fontsize(1) end)
|
||||||
|
vim.keymap.set('n', '<C-->', function() adjust_fontsize(-1) end)
|
||||||
|
|
||||||
|
-- FZF Bindings
|
||||||
|
vim.keymap.set('n', '<leader>h', '<cmd>FzfLua oldfiles<cr>')
|
||||||
|
vim.keymap.set('n', '<leader>t', '<cmd>FzfLua lsp_live_workspace_symbols<cr>')
|
||||||
|
vim.keymap.set('n', '<leader>T', '<cmd>FzfLua lsp_finder<cr>')
|
||||||
|
vim.keymap.set('n', '<leader>b', '<cmd>FzfLua buffers<cr>')
|
||||||
|
vim.keymap.set('n', '<leader><leader>', '<cmd>FzfLua<cr>')
|
||||||
|
|
||||||
|
-- Window navigation
|
||||||
|
vim.keymap.set('n', '<C-h>', '<C-w>h', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-j>', '<C-w>j', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-k>', '<C-w>k', { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-l>', '<C-w>l', { silent = true })
|
||||||
|
|
||||||
|
-- Move by wrapped lines
|
||||||
|
vim.keymap.set('n', 'j', 'gj')
|
||||||
|
vim.keymap.set('n', 'k', 'gk')
|
||||||
|
vim.keymap.set('n', 'gj', 'j')
|
||||||
|
vim.keymap.set('n', 'gk', 'k')
|
||||||
|
|
||||||
|
-- NERDTree
|
||||||
|
vim.keymap.set('n', '<C-n>', ':NERDTreeToggle<CR>')
|
||||||
|
|
||||||
|
-- Change to current buffer's directory
|
||||||
|
vim.keymap.set('n', 'cd', function()
|
||||||
|
vim.cmd('cd ' .. vim.fn.expand('%:p:h'))
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Buffer splitting
|
||||||
|
vim.keymap.set('n', '<leader>s', ':vs<CR>')
|
||||||
|
|
||||||
|
-- Quickfix navigation
|
||||||
|
vim.keymap.set('n', '<A-j>', ':cn<CR>')
|
||||||
|
vim.keymap.set('n', '<A-k>', ':cp<CR>')
|
||||||
|
|
||||||
|
-- Terminal escape
|
||||||
|
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
|
||||||
|
|
||||||
|
-- Make (Vim Dispatch)
|
||||||
|
vim.keymap.set('n', '<C-b>', ':Make<CR>', { noremap = true })
|
||||||
|
|
||||||
|
-- Easy-Align
|
||||||
|
vim.keymap.set('x', '<leader>a', '<Plug>(LiveEasyAlign)')
|
||||||
|
|
||||||
|
-- RAD Debugger
|
||||||
|
vim.keymap.set('n', '<F6>', function() raddbg_open_file() end, { silent = true })
|
||||||
|
vim.keymap.set('n', '<F5>', function() raddbg_start_debugging() end, { silent = true })
|
||||||
|
vim.keymap.set('n', '<S-F5>', function() raddbg_stop_debugging() end, { silent = true })
|
||||||
|
vim.keymap.set('n', '<F9>', function() raddbg_add_breakpoint() end, { silent = true })
|
||||||
|
vim.keymap.set('n', '<C-F10>', function() raddbg_run_to_cursor() end, { silent = true })
|
||||||
@@ -1,384 +0,0 @@
|
|||||||
" Plugins //////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
call plug#begin(stdpath('config') . '/plugged')
|
|
||||||
" nerdtree provides a file tree explorer
|
|
||||||
" vim-dispatch allows running async jobs in vim (i.e. builds in the background)
|
|
||||||
Plug 'https://github.com/scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
Plug 'https://github.com/tpope/vim-dispatch'
|
|
||||||
Plug 'https://github.com/tpope/vim-fugitive'
|
|
||||||
Plug 'https://github.com/tpope/vim-abolish'
|
|
||||||
Plug 'https://github.com/LunarVim/bigfile.nvim'
|
|
||||||
|
|
||||||
" FZF
|
|
||||||
Plug 'junegunn/fzf'
|
|
||||||
Plug 'ibhagwan/fzf-lua', {'branch': 'main'}
|
|
||||||
Plug 'nvim-tree/nvim-web-devicons'
|
|
||||||
|
|
||||||
" Other ////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
" TODO: 2022-06-19 Treesitter is too slow on large C++ files
|
|
||||||
" Plug 'https://github.com/nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
Plug 'https://github.com/bfrg/vim-cpp-modern'
|
|
||||||
Plug 'https://github.com/ggandor/leap.nvim'
|
|
||||||
Plug 'https://github.com/sainnhe/gruvbox-material'
|
|
||||||
Plug 'https://github.com/Tetralux/odin.vim' "Odin Syntax highlighting
|
|
||||||
|
|
||||||
" Harpoon //////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
Plug 'nvim-lua/plenary.nvim'
|
|
||||||
|
|
||||||
" lsp-zero begin
|
|
||||||
" LSP Support
|
|
||||||
Plug 'williamboman/mason.nvim'
|
|
||||||
Plug 'williamboman/mason-lspconfig.nvim'
|
|
||||||
Plug 'neovim/nvim-lspconfig'
|
|
||||||
Plug 'hrsh7th/nvim-cmp'
|
|
||||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
||||||
Plug 'L3MON4D3/LuaSnip'
|
|
||||||
Plug 'hrsh7th/cmp-buffer'
|
|
||||||
Plug 'hrsh7th/cmp-path'
|
|
||||||
Plug 'huggingface/llm.nvim'
|
|
||||||
" lsp-zero end
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Lua Setup ////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
lua <<EOF
|
|
||||||
local leap = require('leap')
|
|
||||||
vim.keymap.set({'n', 'x', 'o'}, '<tab>', '<Plug>(leap)')
|
|
||||||
vim.keymap.set({'n', 'x', 'o'}, '<S-tab>', '<Plug>(leap-from-window)')
|
|
||||||
|
|
||||||
require('bigfile').setup()
|
|
||||||
require('fzf-lua').setup{
|
|
||||||
winopts = {
|
|
||||||
height=0.95,
|
|
||||||
width=0.95
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Vim Dispatch //////////////////////////////////////////////////////////////////////////////////
|
|
||||||
if vim.fn.has('win64') or vim.fn.has('win32') or vim.fn.has('win16') then
|
|
||||||
if os.getenv('SHELL') ~= nil then
|
|
||||||
vim.o.shellcmdflag = '-c'
|
|
||||||
vim.o.makeprg = "./build.sh"
|
|
||||||
else
|
|
||||||
vim.o.makeprg = "build.bat"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- vim.api.nvim_set_keymap('t', '<Esc>', '<C-\\><C-n>', {noremap = true})
|
|
||||||
vim.o.makeprg = "./build.sh"
|
|
||||||
end
|
|
||||||
vim.api.nvim_set_keymap('n', '<C-b>', ':Make<CR>', {noremap = true})
|
|
||||||
|
|
||||||
-- LSP Setup /////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
require('mason').setup({})
|
|
||||||
require('mason-lspconfig').setup({
|
|
||||||
ensure_installed = { "clangd" },
|
|
||||||
automatic_enable = true
|
|
||||||
})
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
vim.keymap.set("n", "<F2>", vim.lsp.buf.rename, opts)
|
|
||||||
vim.keymap.set("n", "<F4>", vim.lsp.buf.code_action, opts)
|
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
||||||
|
|
||||||
local cmp = require('cmp')
|
|
||||||
cmp.setup({
|
|
||||||
sources = {
|
|
||||||
{name = 'nvim_lsp'},
|
|
||||||
{name = 'buffer'},
|
|
||||||
{name = 'path'},
|
|
||||||
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
|
||||||
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
}),
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
--- (Optional) Show source name in completion menu
|
|
||||||
formatting = cmp_format,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- LLM ///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
-- local llm = require('llm')
|
|
||||||
-- llm.setup({
|
|
||||||
-- api_token = nil, -- cf Install paragraph
|
|
||||||
-- model = "codellama/CodeLlama-13b-hf", -- the model ID, behavior depends on backend
|
|
||||||
-- backend = "openai", -- backend ID, "huggingface" | "ollama" | "openai" | "tgi"
|
|
||||||
-- url = "http://localhost:8080/v1/chat/completions", -- the http url of the backend
|
|
||||||
-- tokens_to_clear = { "<EOT>" }, -- tokens to remove from the model's output
|
|
||||||
-- -- parameters that are added to the request body, values are arbitrary, you can set any field:value pair here it will be passed as is to the backend
|
|
||||||
-- request_body = { },
|
|
||||||
-- -- set this if the model supports fill in the middle
|
|
||||||
-- fim = {
|
|
||||||
-- enabled = true,
|
|
||||||
-- prefix = "<PRE> ",
|
|
||||||
-- middle = " <MID>",
|
|
||||||
-- suffix = " <SUF>",
|
|
||||||
-- },
|
|
||||||
-- debounce_ms = 150,
|
|
||||||
-- accept_keymap = "<S-CR>",
|
|
||||||
-- dismiss_keymap = "<CR>",
|
|
||||||
-- tls_skip_verify_insecure = false,
|
|
||||||
-- -- llm-ls configuration, cf llm-ls section
|
|
||||||
-- lsp = {
|
|
||||||
-- bin_path = "C:/Home/Downloads/llm-ls.exe",
|
|
||||||
-- host = nil,
|
|
||||||
-- port = nil,
|
|
||||||
-- },
|
|
||||||
-- tokenizer = {
|
|
||||||
-- path = "C:/Home/Models/codellama-7b_tokenizer.json",
|
|
||||||
-- }, -- cf Tokenizer paragraph
|
|
||||||
-- context_window = 4096, -- max number of tokens for the context window
|
|
||||||
-- enable_suggestions_on_startup = true,
|
|
||||||
-- enable_suggestions_on_files = "*", -- pattern matching syntax to enable suggestions on specific files, either a string or a list of strings
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Treesitter ////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
-- TODO: 2022-06-19 Treesitter is too slow on large C++ files
|
|
||||||
-- require('nvim-treesitter.configs').setup {
|
|
||||||
-- ensure_installed = { "c", "cpp" }, -- A list of parser names, or "all"
|
|
||||||
-- sync_install = false, -- Install parsers synchronously (only applied to `ensure_installed`)
|
|
||||||
-- ignore_install = { }, -- List of parsers to ignore installing (for "all")
|
|
||||||
|
|
||||||
-- highlight = {
|
|
||||||
-- enable = false, -- `false` will disable the whole extension
|
|
||||||
|
|
||||||
-- -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
|
||||||
-- -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
|
||||||
-- -- the name of the parser)
|
|
||||||
-- -- list of language that will be disabled
|
|
||||||
-- disable = { },
|
|
||||||
|
|
||||||
-- -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
|
||||||
-- -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
|
||||||
-- -- Using this option may slow down your editor, and you may see some duplicate highlights.
|
|
||||||
-- -- Instead of true it can also be a list of languages
|
|
||||||
-- additional_vim_regex_highlighting = false,
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
|
|
||||||
|
|
||||||
-- Per-Project Bindings /////////////////////////////////////////////////////////////////////////////
|
|
||||||
-- Automatically load project file on buffer enter
|
|
||||||
vim.api.nvim_create_autocmd({"BufEnter"}, {
|
|
||||||
callback = function(ev)
|
|
||||||
local project_file = vim.fn.expand('%:p:h') .. '/project_nvim.lua'
|
|
||||||
if vim.fn.filereadable(project_file) == 1 then
|
|
||||||
vim.cmd('luafile ' .. vim.fn.fnameescape(project_file))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Vim Options ///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
vim.opt.autowrite=true -- Automatically save before cmds like :next and :prev
|
|
||||||
vim.opt.colorcolumn={80, 100} -- Set a 80 and 100 char column ruler
|
|
||||||
vim.opt.completeopt={'menu', 'menuone', 'noselect'}
|
|
||||||
vim.opt.cpoptions:append('$') -- $ as end marker for the change operator
|
|
||||||
vim.opt.cursorline=true -- Highlight current line
|
|
||||||
vim.opt.expandtab=true -- Replace tabs with spaces
|
|
||||||
vim.opt.guifont='JetBrains_Mono:h9','Consolas:h9','InputMonoCondensed:h9'
|
|
||||||
vim.opt.hlsearch=false -- Highlight just the first match on search
|
|
||||||
vim.opt.ignorecase=true -- Search is not case sensitive
|
|
||||||
vim.opt.linebreak=true -- On wrapped lines, break on the wrapping word intelligently
|
|
||||||
vim.opt.list=true -- Show the 'listchar' characters on trailing spaces, tabs e.t.c ===
|
|
||||||
vim.opt.listchars:append('tab:>-,trail:■,extends:»,precedes:«')
|
|
||||||
vim.opt.number=true -- Show line numbers
|
|
||||||
vim.opt.relativenumber=true -- Show relative line numbers
|
|
||||||
vim.opt.shiftwidth=4 -- Number of spaces for each autoindent step
|
|
||||||
vim.opt.splitright=true -- Open new splits to the right of the current one
|
|
||||||
vim.opt.swapfile=false -- Disable swapfile (stores the things changed in a file)
|
|
||||||
vim.opt.textwidth=80 -- On format, format to 80 char long lines
|
|
||||||
vim.opt.visualbell=true -- Flash the screen on error
|
|
||||||
vim.opt.wrap=false -- Don't wrap lines of text automatically
|
|
||||||
vim.opt.signcolumn = 'no'
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
-- Turn off the diagnostics signs on the line number. In LSP mode, editing
|
|
||||||
-- a C++ buffer constantly toggles the sign column on and off as you change
|
|
||||||
-- modes which is very visually distracting.
|
|
||||||
signs = false,
|
|
||||||
virtual_text = true
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Automatically scroll to bottom of quickfix window when opened
|
|
||||||
vim.cmd([[
|
|
||||||
autocmd FileType qf lua vim.cmd('normal! G')
|
|
||||||
]])
|
|
||||||
EOF
|
|
||||||
|
|
||||||
" Theme ////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
let g:gruvbox_material_background='hard'
|
|
||||||
let g:gruvbox_material_foreground='mix'
|
|
||||||
let g:gruvbox_material_disable_italic_comment=1
|
|
||||||
let g:gruvbox_material_enable_italic=0
|
|
||||||
let g:gruvbox_material_enable_bold=0
|
|
||||||
let g:gruvbox_material_diagnostic_virtual_text='colored'
|
|
||||||
let g:gruvbox_material_better_performance=1
|
|
||||||
colorscheme gruvbox-material
|
|
||||||
|
|
||||||
" Vim-cpp-modern customisation
|
|
||||||
" Disable function highlighting (affects both C and C++ files)
|
|
||||||
let g:cpp_function_highlight = 1
|
|
||||||
|
|
||||||
" Enable highlighting of C++11 attributes
|
|
||||||
let g:cpp_attributes_highlight = 1
|
|
||||||
|
|
||||||
" Highlight struct/class member variables (affects both C and C++ files)
|
|
||||||
let g:cpp_member_highlight = 0
|
|
||||||
|
|
||||||
" Put all standard C and C++ keywords under Vim's highlight group 'Statement'
|
|
||||||
" (affects both C and C++ files)
|
|
||||||
let g:cpp_simple_highlight = 1
|
|
||||||
|
|
||||||
" Options //////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
" Show EOL type and last modified timestamp, right after the filename
|
|
||||||
set statusline=%<%F%h%m%r\ [%{&ff}]\ (%{strftime(\"%H:%M\ %d/%m/%Y\",getftime(expand(\"%:p\")))})%=%l,%c%V\ %P
|
|
||||||
|
|
||||||
" File patterns to ignore in command line auto complete
|
|
||||||
set wildignore+=*.class,*.o,*\\tmp\\*,*.swp,*.zip,*.exe,*.obj,*.vcxproj,*.pdb,*.idb
|
|
||||||
|
|
||||||
" Setup undo file
|
|
||||||
set undofile
|
|
||||||
let &undodir=stdpath('config') . '/undo'
|
|
||||||
|
|
||||||
" Setup backup directory
|
|
||||||
let &backupdir=stdpath('config') . '/backup'
|
|
||||||
|
|
||||||
" Enable mouse support
|
|
||||||
if has('mouse')
|
|
||||||
set mouse=a
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Functions ////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
" Increase font size using (Ctrl+Up Arrow) or (Ctrl+Down Arrow) if we are using
|
|
||||||
" gvim Otherwise font size is determined in terminal
|
|
||||||
nnoremap <C-Up> :silent! let &guifont = substitute(
|
|
||||||
\ &guifont,
|
|
||||||
\ ':h\zs\d\+',
|
|
||||||
\ '\=eval(submatch(0)+1)',
|
|
||||||
\ 'g')<CR>
|
|
||||||
nnoremap <C-Down> :silent! let &guifont = substitute(
|
|
||||||
\ &guifont,
|
|
||||||
\ ':h\zs\d\+',
|
|
||||||
\ '\=eval(submatch(0)-1)',
|
|
||||||
\ 'g')<CR>
|
|
||||||
|
|
||||||
" Formatting options (see :h fo-table)
|
|
||||||
augroup persistent_settings
|
|
||||||
au!
|
|
||||||
au bufenter * :set formatoptions=q1j
|
|
||||||
augroup end
|
|
||||||
|
|
||||||
function! RADDbgOpenFile()
|
|
||||||
execute("!dev raddbg --ipc open " . substitute(expand("%:p"), '\\', '/', 'g'))
|
|
||||||
execute("!dev raddbg --ipc goto_line " . line("."))
|
|
||||||
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
|
||||||
endfunction
|
|
||||||
command RADDbgOpenFile call RADDbgOpenFile()
|
|
||||||
|
|
||||||
function! RADDbgStartDebugging()
|
|
||||||
execute("!dev raddbg --ipc run")
|
|
||||||
endfunction
|
|
||||||
command RADDbgStartDebugging call RADDbgStartDebugging()
|
|
||||||
|
|
||||||
function! RADDbgStopDebugging()
|
|
||||||
execute("!dev raddbg --ipc kill_all")
|
|
||||||
endfunction
|
|
||||||
command RADDbgStopDebugging call RADDbgStopDebugging()
|
|
||||||
|
|
||||||
function! RADDbgRunToCursor()
|
|
||||||
execute("!dev raddbg --ipc open " . substitute(expand("%:p"), '\\', '/', 'g'))
|
|
||||||
execute("!dev raddbg --ipc goto_line " . line("."))
|
|
||||||
execute("!dev raddbg --ipc run_to_cursor " . substitute(expand("%:p"), '\\', '/', 'g') . ":" . line("."))
|
|
||||||
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
|
||||||
endfunction
|
|
||||||
command RADDbgRunToCursor call RADDbgRunToCursor()
|
|
||||||
|
|
||||||
function! RADDbgAddBreakpointAtFile()
|
|
||||||
execute("!dev raddbg --ipc open " . substitute(expand("%:p"), '\\', '/', 'g'))
|
|
||||||
execute("!dev raddbg --ipc goto_line " . line("."))
|
|
||||||
execute("!dev raddbg --ipc toggle_breakpoint " . substitute(expand("%:p"), '\\', '/', 'g') . ":" . line("."))
|
|
||||||
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
|
|
||||||
endfunction
|
|
||||||
command RADDbgAddBreakpointAtFile call RADDbgAddBreakpointAtFile()
|
|
||||||
|
|
||||||
nnoremap <silent> <F6> <cmd>RADDbgOpenFile<cr><cr>
|
|
||||||
nnoremap <silent> <F5> <cmd>RADDbgStartDebugging<cr><cr>
|
|
||||||
nnoremap <silent> <S-F5> <cmd>RADDbgStopDebugging<cr><cr>
|
|
||||||
nnoremap <silent> <F9> <cmd>RADDbgAddBreakpointAtFile<cr><cr>
|
|
||||||
nnoremap <silent> <C-F10> <cmd>RADDbgRunToCursor<cr><cr>
|
|
||||||
|
|
||||||
" General Key Bindings /////////////////////////////////////////////////////////////////////////////
|
|
||||||
" FZF Bindings
|
|
||||||
nnoremap <leader>h <cmd>FzfLua oldfiles<cr>
|
|
||||||
nnoremap <leader>f <cmd>FzfLua files<cr>
|
|
||||||
nnoremap <leader>r <cmd>FzfLua live_grep<cr>
|
|
||||||
nnoremap <leader>R <cmd>FzfLua grep_cword<cr>
|
|
||||||
nnoremap <leader>t <cmd>FzfLua lsp_live_workspace_symbols<cr>
|
|
||||||
nnoremap <leader>T <cmd>FzfLua lsp_finder<cr>
|
|
||||||
nnoremap <leader>b <cmd>FzfLua buffers<cr>
|
|
||||||
nnoremap <leader><leader> <cmd>FzfLua<cr>
|
|
||||||
|
|
||||||
" Map Ctrl+HJKL to navigate buffer window
|
|
||||||
nmap <silent> <C-h> :wincmd h<CR>
|
|
||||||
nmap <silent> <C-j> :wincmd j<CR>
|
|
||||||
nmap <silent> <C-k> :wincmd k<CR>
|
|
||||||
nmap <silent> <C-l> :wincmd l<CR>
|
|
||||||
|
|
||||||
" Move by wrapped lines instead of line numbers
|
|
||||||
nnoremap j gj
|
|
||||||
nnoremap k gk
|
|
||||||
nnoremap gj j
|
|
||||||
nnoremap gk k
|
|
||||||
|
|
||||||
" Map NERDTree to Ctrl-N
|
|
||||||
map <C-n> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" Change to current buffer's directory
|
|
||||||
nmap cd :cd <C-R>=expand("%:p:h")<CR><CR>
|
|
||||||
|
|
||||||
" Buffer Splitting
|
|
||||||
nnoremap <leader>s :vs<CR>
|
|
||||||
|
|
||||||
" Go to next error
|
|
||||||
" Go to previous error
|
|
||||||
nnoremap <A-j> :cn<CR>
|
|
||||||
nnoremap <A-k> :cp<CR>
|
|
||||||
|
|
||||||
" In Neovim terminal, pressing <ESC> should go back into normal mode.
|
|
||||||
" Without this, this doesn't happen and you stay stuck in insert mode.
|
|
||||||
tnoremap <Esc> <C-\><C-n>
|
|
||||||
|
|
||||||
" Easy-Align ///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
let g:easy_align_delimiters = {
|
|
||||||
\ '>': { 'pattern': '>>\|=>\|>' },
|
|
||||||
\ '/': {
|
|
||||||
\ 'pattern': '//\+\|/\*\|\*/',
|
|
||||||
\ 'delimiter_align': 'l',
|
|
||||||
\ 'ignore_groups': ['!Comment'] },
|
|
||||||
\ ']': {
|
|
||||||
\ 'pattern': '[[\]]',
|
|
||||||
\ 'left_margin': 0,
|
|
||||||
\ 'right_margin': 0,
|
|
||||||
\ 'stick_to_left': 0
|
|
||||||
\ },
|
|
||||||
\ ')': {
|
|
||||||
\ 'pattern': '[)]',
|
|
||||||
\ 'left_margin': 0,
|
|
||||||
\ 'right_margin': 0,
|
|
||||||
\ 'stick_to_left': 0
|
|
||||||
\ },
|
|
||||||
\ '(': {
|
|
||||||
\ 'pattern': '[(]',
|
|
||||||
\ 'left_margin': 0,
|
|
||||||
\ 'right_margin': 0,
|
|
||||||
\ 'stick_to_left': 0
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
" Enter live-interactive easy align mode when a visual selection is active
|
|
||||||
xmap <leader>a <Plug>(LiveEasyAlign)
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Setup ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
script_path=$0
|
||||||
|
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
root_dir="${devenver_root}"
|
||||||
|
|
||||||
|
# Arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
clang_dir="$root_dir/LLVM"
|
||||||
|
cmake_dir="$root_dir/CMake"
|
||||||
|
node_dir="$root_dir/NodeJS"
|
||||||
|
python_dir="$root_dir/Python"
|
||||||
|
virustotal_url="https://www.virustotal.com/gui/file"
|
||||||
|
|
||||||
|
# Argument parsing :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
option="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ "$option" = "clang" ]; then exe_dir="$clang_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
|
||||||
|
if [ "$option" = "cmake" ]; then exe_dir="$cmake_dir/$1" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
|
||||||
|
if [ "$option" = "node" ]; then exe_dir="$node_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
|
||||||
|
if [ "$option" = "python" ]; then
|
||||||
|
python_root=$python_dir/$1/install
|
||||||
|
# Shit like building UWSGI in Python via PIP with wheel doesn't seem to use
|
||||||
|
# LD_LIBRARY_PATH but LDFLAGS works. Dependency hell
|
||||||
|
cmd_prefix="LDFLAGS=${python_root}/lib LD_LIBRARY_PATH=$python_root/lib:$LD_LIBRARY_PATH PYTHONHOME=$python_root"
|
||||||
|
exe_dir="$python_root/bin"
|
||||||
|
PATH="$exe_dir:$PATH"
|
||||||
|
cmd_line="$2"&& shift && shift;
|
||||||
|
fi
|
||||||
|
if [ "$option" = "virustotal" ]; then virustotal_hash=$(sha256sum "$1" | awk '{print $1}') && cmd_line="xdg-open $virustotal_url/$virustotal_hash &" && shift; fi
|
||||||
|
|
||||||
|
if [ -z "$cmd_line" ]; then option="help"; fi
|
||||||
|
if [ "$option" = "help" ]; then
|
||||||
|
clang_versions=$(ls -1 "$clang_dir" 2>/dev/null | tr '\n' ' ')
|
||||||
|
cmake_versions=$(ls -1 "$cmake_dir" 2>/dev/null | tr '\n' ' ')
|
||||||
|
node_versions=$(ls -1 "$node_dir" 2>/dev/null | tr '\n' ' ')
|
||||||
|
python_versions=$(ls -1 "$python_dir" 2>/dev/null | tr '\n' ' ')
|
||||||
|
cat << EOF
|
||||||
|
USAGE: dev [option] [args...]
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
Commands augment the system PATH with the tool's path for the current shell session.
|
||||||
|
You can chain the commands to augment the PATH, e.g:
|
||||||
|
|
||||||
|
dev.sh python 3.12.9+20250317 dev.sh node 20.18.2 yarn build-everything
|
||||||
|
|
||||||
|
OPTIONS:
|
||||||
|
cmake [version] [cmd...] CMake build system: 'PATH=$cmake_dir/[version]:\$PATH [cmd...]'
|
||||||
|
Versions: $cmake_versions
|
||||||
|
|
||||||
|
clang [version] [cmd..] CLANG compiler: 'PATH=$clang_dir/[version]:\$PATH [cmd...]'
|
||||||
|
Example: 'dev clang 18.1.4 clang++.exe --help'
|
||||||
|
Versions: $clang_versions
|
||||||
|
|
||||||
|
node [version] [cmd...] Node JS: 'PATH=$node_dir/[version]:\$PATH [cmd...]'
|
||||||
|
Versions: $node_versions
|
||||||
|
|
||||||
|
python [version] [cmd...] Python: 'PATH=$python_dir/[version]/install/bin:\$PATH [cmd...]'
|
||||||
|
Versions: $python_versions
|
||||||
|
|
||||||
|
virustotal [file] Lookup file SHA256 hash on VirusTotal: '$virustotal_url/[file]'
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract user arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
user_args=""
|
||||||
|
while [ $# -gt 0 ]; do user_args="$user_args $1"; shift; done
|
||||||
|
|
||||||
|
# Trim trailing space ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
while [ "${user_args: -1}" = " " ]; do user_args="${user_args% }"; done
|
||||||
|
while [ "${cmd_line: -1}" = " " ]; do cmd_line="${cmd_line% }"; done
|
||||||
|
|
||||||
|
# Eval ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
echo "DEV: Running '$script_path' with '$cmd_prefix $cmd_line$user_args'"
|
||||||
|
eval "$cmd_prefix $cmd_line$user_args"
|
||||||
@@ -24,6 +24,7 @@ set rad_update_exe=update_trunk.bat
|
|||||||
set remedybg_dir=%root_dir%\RemedyBG
|
set remedybg_dir=%root_dir%\RemedyBG
|
||||||
set remedybg_exe=remedybg.exe
|
set remedybg_exe=remedybg.exe
|
||||||
set virustotal_url=https://www.virustotal.com/gui/file
|
set virustotal_url=https://www.virustotal.com/gui/file
|
||||||
|
set rust_dir=%userprofile%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin
|
||||||
|
|
||||||
:: Argument parsing ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
:: Argument parsing ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
:: Remove the first argument which is the command (e.g. raddbg or radlink)
|
:: Remove the first argument which is the command (e.g. raddbg or radlink)
|
||||||
@@ -39,6 +40,7 @@ if "%option%"=="raddbg" set "exe_dir=%raddbg_dir%" && set path=%exe_
|
|||||||
if "%option%"=="raddbg_env" endlocal && set path=%raddbg_dir%;%path% && goto :eof
|
if "%option%"=="raddbg_env" endlocal && set path=%raddbg_dir%;%path% && goto :eof
|
||||||
if "%option%"=="radlink" set "exe_dir=%radlink_dir%" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%radlink_exe%
|
if "%option%"=="radlink" set "exe_dir=%radlink_dir%" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%radlink_exe%
|
||||||
if "%option%"=="radlink_env" endlocal && set path=%radlink_dir%;%path% && goto :eof
|
if "%option%"=="radlink_env" endlocal && set path=%radlink_dir%;%path% && goto :eof
|
||||||
|
if "%option%"=="rust_env" endlocal && set path=%rsut_dir%;%path% && goto :eof
|
||||||
if "%option%"=="remedybg" set "exe_dir=%remedybg_dir%\%1" && set path=%exe_dir%;%path% && set cmd_line=start /B !exe_dir!\%remedybg_exe% && shift
|
if "%option%"=="remedybg" set "exe_dir=%remedybg_dir%\%1" && set path=%exe_dir%;%path% && set cmd_line=start /B !exe_dir!\%remedybg_exe% && shift
|
||||||
if "%option%"=="virustotal" for /f "delims=" %%a in ('powershell -Command "(Get-FileHash \"%1\" -Algorithm SHA256).Hash"') do set virustotal_hash=%%a && shift
|
if "%option%"=="virustotal" for /f "delims=" %%a in ('powershell -Command "(Get-FileHash \"%1\" -Algorithm SHA256).Hash"') do set virustotal_hash=%%a && shift
|
||||||
if "%option%"=="virustotal" set cmd_line=start /B %virustotal_url%/%virustotal_hash%
|
if "%option%"=="virustotal" set cmd_line=start /B %virustotal_url%/%virustotal_hash%
|
||||||
@@ -55,14 +57,13 @@ if "%option%"=="help" (
|
|||||||
echo USAGE: dev [option] [args...]
|
echo USAGE: dev [option] [args...]
|
||||||
echo.
|
echo.
|
||||||
echo NOTES:
|
echo NOTES:
|
||||||
echo Commands suffixed with '_env' augment the system path with the path to the tool for the
|
echo Commands augment the system path with the path to the tool for the current shell session.
|
||||||
echo current shell session.
|
|
||||||
echo.
|
echo.
|
||||||
echo OPTIONS:
|
echo OPTIONS:
|
||||||
echo cmake [version] [exe] CMake build system: '%cmake_dir%\[version]\[exe] %cmake_args%'
|
echo cmake [version] [exe] CMake build system: 'set PATH=%cmake_dir%\[version]\[exe];%%PATH%% %cmake_args%'
|
||||||
echo Versions: !cmake_versions!
|
echo Versions: !cmake_versions!
|
||||||
echo.
|
echo.
|
||||||
echo clang [version] [exe] CLANG compiler: '%clang_dir%\[version]\[exe] %clang_args%'
|
echo clang [version] [exe] CLANG compiler: 'set PATH=%clang_dir%\[version]\[exe];%%PATH%% %clang_args%'
|
||||||
echo Example: 'dev clang 18.1.4 clang++.exe --help'
|
echo Example: 'dev clang 18.1.4 clang++.exe --help'
|
||||||
echo Versions: !clang_versions!
|
echo Versions: !clang_versions!
|
||||||
echo.
|
echo.
|
||||||
@@ -75,14 +76,20 @@ if "%option%"=="help" (
|
|||||||
echo Versions: !node_versions!
|
echo Versions: !node_versions!
|
||||||
echo.
|
echo.
|
||||||
echo raddbg RAD debugger: '%raddbg_dir%\%raddbg_exe% %raddbg_args%'
|
echo raddbg RAD debugger: '%raddbg_dir%\%raddbg_exe% %raddbg_args%'
|
||||||
echo raddbg_env [cmd...] '%raddbg_dir%;[PATH]'
|
echo raddbg_env Add RAD debugger to PATH env: 'set PATH=%raddbg_dir%;%%PATH%%'
|
||||||
echo radlink RAD linker: '%radlink_dir%\%radlink_exe%'
|
echo radlink RAD linker: '%radlink_dir%\%radlink_exe%'
|
||||||
echo radlink_env [cmd...] '%radlink_dir%;[PATH]'
|
echo radlink_env Add RAD linker to PATH env: 'set PATH=%radlink_dir%;%%PATH%%'
|
||||||
echo rad_update Update the RAD linker and debugger: '%rad_update_dir%\%rad_update_exe%'
|
echo rad_update Update the RAD linker and debugger: '%rad_update_dir%\%rad_update_exe%'
|
||||||
|
echo.
|
||||||
echo remedybg [version] C/C++ debugger: '%remedybg_dir%\%remedybg_exe%'
|
echo remedybg [version] C/C++ debugger: '%remedybg_dir%\%remedybg_exe%'
|
||||||
echo Versions: !remedybg_versions!
|
echo Versions: !remedybg_versions!
|
||||||
echo.
|
echo.
|
||||||
|
if exist "!rust_dir!\cargo.exe" (
|
||||||
|
echo rust_env Add Rust to PATH env: 'set PATH=!rust_dir!;%%PATH%%'
|
||||||
|
echo.
|
||||||
|
)
|
||||||
echo virustotal [file] Lookup file SHA256 hash on VirusTotal: '%virustotal_url%/[file]'
|
echo virustotal [file] Lookup file SHA256 hash on VirusTotal: '%virustotal_url%/[file]'
|
||||||
|
|
||||||
goto :eof
|
goto :eof
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
@echo off
|
|
||||||
start /B https://brave.com
|
|
||||||
start /B https://desktop.telegram.org
|
|
||||||
start /B https://ledger.com/ledger-live
|
|
||||||
start /B https://getsession.org/windows
|
|
||||||
start /B https://github.com/kapitainsky/RcloneBrowser/releases
|
|
||||||
start /B https://mozilla.org/en-US/firefox/new
|
|
||||||
start /B https://obsidian.md/download
|
|
||||||
start /B https://protonvpn.com/download
|
|
||||||
start /B https://signal.org/download
|
|
||||||
start /B https://safing.io
|
|
||||||
start /B https://spotify.com/us/download
|
|
||||||
start /B https://discord.com/download
|
|
||||||
start /B https://www.gpsoft.com.au/dscripts/download.asp
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Setup ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
script_path=$0
|
|
||||||
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
root_dir="${devenver_root}"
|
|
||||||
|
|
||||||
# Arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
clang_dir="$root_dir/LLVM"
|
|
||||||
cmake_dir="$root_dir/CMake"
|
|
||||||
node_dir="$root_dir/NodeJS"
|
|
||||||
python_dir="$root_dir/Python"
|
|
||||||
virustotal_url="https://www.virustotal.com/gui/file"
|
|
||||||
|
|
||||||
# Argument parsing :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
option="$1"
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ "$option" = "clang" ]; then exe_dir="$clang_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$exe_dir/$2" && shift && shift; fi
|
|
||||||
if [ "$option" = "cmake" ]; then exe_dir="$cmake_dir/$1" && PATH="$exe_dir:$PATH" && cmd_line="$exe_dir/$2" && shift && shift; fi
|
|
||||||
if [ "$option" = "node" ]; then exe_dir="$node_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$exe_dir/$2" && shift && shift; fi
|
|
||||||
if [ "$option" = "node_env" ]; then PATH="$node_dir/$1/bin:$PATH" && shift && cmd_line="$1" && shift; fi
|
|
||||||
if [ "$option" = "python" ]; then cmd_prefix="LD_LIBRARY_PATH=$python_dir/$1/install/lib:$LD_LIBRARY_PATH" && exe_dir="$python_dir/$1/install/bin" && PATH="$exe_dir:$PATH" && cmd_line="$exe_dir/$2" && shift && shift; fi
|
|
||||||
if [ "$option" = "python_env" ]; then cmd_prefix="LD_LIBRARY_PATH=$python_dir/$1/install/lib:$LD_LIBRARY_PATH" && PATH="$python_dir/$1/install/bin:$PATH" && shift && cmd_line="$1" && shift; fi
|
|
||||||
if [ "$option" = "virustotal" ]; then virustotal_hash=$(sha256sum "$1" | awk '{print $1}') && cmd_line="xdg-open $virustotal_url/$virustotal_hash &" && shift; fi
|
|
||||||
|
|
||||||
if [ -z "$cmd_line" ]; then option="help"; fi
|
|
||||||
if [ "$option" = "help" ]; then
|
|
||||||
clang_versions=$(ls -1 "$clang_dir" 2>/dev/null | tr '\n' ' ')
|
|
||||||
cmake_versions=$(ls -1 "$cmake_dir" 2>/dev/null | tr '\n' ' ')
|
|
||||||
node_versions=$(ls -1 "$node_dir" 2>/dev/null | tr '\n' ' ')
|
|
||||||
python_versions=$(ls -1 "$python_dir" 2>/dev/null | tr '\n' ' ')
|
|
||||||
cat << EOF
|
|
||||||
USAGE: dev [option] [args...]
|
|
||||||
|
|
||||||
NOTES:
|
|
||||||
Commands suffixed with '_env' augment the system PATH with the tool's path for the current shell session.
|
|
||||||
You can chain the '_env' commands to augment the PATH, e.g:
|
|
||||||
|
|
||||||
dev.sh python_env 3.12.9+20250317 dev.sh node 20.18.2 yarn build-everything
|
|
||||||
|
|
||||||
OPTIONS:
|
|
||||||
cmake [version] [exe] CMake build system: '$cmake_dir/[version]/[exe]'
|
|
||||||
Versions: $cmake_versions
|
|
||||||
|
|
||||||
clang [version] [exe] CLANG compiler: '$clang_dir/[version]/[exe]'
|
|
||||||
Example: 'dev clang 18.1.4 clang++.exe --help'
|
|
||||||
Versions: $clang_versions
|
|
||||||
|
|
||||||
node [version] [exe] Node JS: '$node_dir/[version]/[exe]'
|
|
||||||
Versions: $node_versions
|
|
||||||
|
|
||||||
python [version] [exe] Python: '$python_dir/[version]/install/bin/[exe]'
|
|
||||||
python_env [cmd...] '$python_dir/[version]/install/bin:[PATH]'
|
|
||||||
Versions: $python_versions
|
|
||||||
|
|
||||||
virustotal [file] Lookup file SHA256 hash on VirusTotal: '$virustotal_url/[file]'
|
|
||||||
EOF
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract user arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
user_args=""
|
|
||||||
while [ $# -gt 0 ]; do user_args="$user_args $1"; shift; done
|
|
||||||
|
|
||||||
# Trim trailing space ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
while [ "${user_args: -1}" = " " ]; do user_args="${user_args% }"; done
|
|
||||||
while [ "${cmd_line: -1}" = " " ]; do cmd_line="${cmd_line% }"; done
|
|
||||||
|
|
||||||
# Eval ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
||||||
echo "DEV: Running '$script_path' with '$cmd_prefix $cmd_line$user_args'"
|
|
||||||
eval "$cmd_prefix $cmd_line$user_args"
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal EnableDelayedExpansion
|
|
||||||
set root_path=%devenver_root%\NodeJS
|
|
||||||
set version=%~1
|
|
||||||
for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b
|
|
||||||
|
|
||||||
if "%~1"=="help" goto :help
|
|
||||||
if "%~1"=="" goto :help
|
|
||||||
if "%~1"=="--help" goto :help
|
|
||||||
if "%~1"=="/?" goto :help
|
|
||||||
goto :run
|
|
||||||
|
|
||||||
:help
|
|
||||||
echo USAGE: node_env.bat ^<version^> [^<command^>]
|
|
||||||
echo.
|
|
||||||
echo VERSIONS:
|
|
||||||
ls %root_path%
|
|
||||||
goto :eof
|
|
||||||
|
|
||||||
:run
|
|
||||||
echo [SCRIPT] Adding to path '%root_path%\%version%' and executing '%remaining_args%'
|
|
||||||
set PATH=%root_path%\%version%;%PATH%
|
|
||||||
%remaining_args%
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal
|
|
||||||
set exe=C:\Home\Cloud\PC\Programs\llamafile\llamafile-0.7
|
|
||||||
echo [DEVENVER] "%~dpnx0" is executing %exe%
|
|
||||||
call %exe% %*
|
|
||||||
endlocal
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
call %devenver_root%\msvc\msvc-14.34.bat
|
|
||||||
call %devenver_root%\msvc\win-sdk-22621.bat
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
call %devenver_root%\msvc\msvc-14.41.bat
|
|
||||||
call %devenver_root%\msvc\win-sdk-22621.bat
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
call %devenver_root%\msvc\setup.bat
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal EnableDelayedExpansion
|
|
||||||
|
|
||||||
if "%~1"=="help" goto :help
|
|
||||||
if "%~1"=="" goto :help
|
|
||||||
if "%~1"=="--help" goto :help
|
|
||||||
if "%~1"=="/?" goto :help
|
|
||||||
if "%~2"=="" goto :help
|
|
||||||
goto :run
|
|
||||||
|
|
||||||
:help
|
|
||||||
echo USAGE: msys2_env.bat ^<environment^> ^<command^>
|
|
||||||
echo.
|
|
||||||
echo ENVIRONMENTS:
|
|
||||||
echo ^| Name ^| Toolchain ^| Arch ^| C Runtime ^| C++ Runtime ^|
|
|
||||||
echo ^| 'clang64' ^| llvm ^| x64 ^| ucrt ^| libc++ ^|
|
|
||||||
echo ^| 'mingw32' ^| gcc ^| x86 ^| msvcrt ^| libstdc++ ^|
|
|
||||||
echo ^| 'mingw64' ^| gcc ^| x64 ^| msvcrt ^| libstdc++ ^|
|
|
||||||
echo ^| 'msys2' ^| gcc ^| x64 ^| cygwin ^| libstdc++ ^|
|
|
||||||
echo ^| 'ucrt64' ^| gcc ^| x64 ^| ucrt ^| libstdc++ ^|
|
|
||||||
goto :eof
|
|
||||||
|
|
||||||
:run
|
|
||||||
set msys_env=%~1
|
|
||||||
for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b
|
|
||||||
|
|
||||||
set cmd=%devenver_root%\MSYS2\20240113\msys2_shell.cmd -%msys_env% -no-start -defterm -here -c "%remaining_args%"
|
|
||||||
echo [SCRIPT] Executing '%cmd%'
|
|
||||||
%cmd%
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal EnableDelayedExpansion
|
|
||||||
set version=%~1
|
|
||||||
for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b
|
|
||||||
|
|
||||||
set root_path=%devenver_root%\NodeJS
|
|
||||||
set bin_path=%root_path%\%version%
|
|
||||||
|
|
||||||
if "%~1"=="help" goto :help
|
|
||||||
if "%~1"=="" goto :help
|
|
||||||
if "%~1"=="--help" goto :help
|
|
||||||
if "%~1"=="/?" goto :help
|
|
||||||
goto :run
|
|
||||||
|
|
||||||
:help
|
|
||||||
echo USAGE: node_env.bat ^<version^> [^<command^>]
|
|
||||||
echo.
|
|
||||||
echo VERSIONS:
|
|
||||||
ls %root_path%
|
|
||||||
goto :eof
|
|
||||||
|
|
||||||
:run
|
|
||||||
echo [SCRIPT] Adding to path '%bin_path%' and executing '%remaining_args%'
|
|
||||||
set PATH=%bin_path%;%PATH%
|
|
||||||
%remaining_args%
|
|
||||||
+19
-217
@@ -79,18 +79,18 @@ def get_manifest(is_windows):
|
|||||||
checksum = ""
|
checksum = ""
|
||||||
symlink = []
|
symlink = []
|
||||||
|
|
||||||
version = "3.29.1"
|
version = "4.2.4"
|
||||||
if is_windows:
|
if is_windows:
|
||||||
exe_path = f"bin/cmake.exe"
|
exe_path = f"bin/cmake.exe"
|
||||||
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-windows-x86_64.zip"
|
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-windows-x86_64.zip"
|
||||||
download_checksum = "c8cf6ed50551d00ad8cd1f3b232810cd0a8b43b4a1d4f1393f0a575d423884dc"
|
download_checksum = "d0fe635f3ddc748485ab1a144a28553cae31ae598a3c22a1de3c31db31251287"
|
||||||
checksum = "cc6050622336a786b336e22171f72ea178fc215b33d17d89b62a3cf6e98ea165"
|
checksum = "89e096daabce5459bcb0fbebd77b19f6a73f6c499725cf3590e06ec25d71e86f"
|
||||||
symlink = [f"cmake-{version}.exe"]
|
symlink = [f"cmake-{version}.exe"]
|
||||||
else:
|
else:
|
||||||
exe_path = f"bin/cmake"
|
exe_path = f"bin/cmake"
|
||||||
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-linux-x86_64.tar.gz"
|
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-linux-x86_64.tar.gz"
|
||||||
download_checksum = "751bbe7ccabb78179335a75b88999b1c52afcd4d8a4cd03217d367d8bb2c5100"
|
download_checksum = "2fc22f96b1e79487d258eaaf565aacb808d1ec99ec64168ebd795dff9dcaeb1d"
|
||||||
checksum = "0c771e1330fc34444dca0e39447332fb82169ab58b4335d8b6eec03917b7cab4"
|
checksum = "945225d98d1d3e5aa731a9321cb7a1b90ca992e737406373bf976cfba80cd8df"
|
||||||
symlink = [f"cmake-{version}"]
|
symlink = [f"cmake-{version}"]
|
||||||
|
|
||||||
result[-1]['manifests'].append({
|
result[-1]['manifests'].append({
|
||||||
@@ -131,7 +131,7 @@ def get_manifest(is_windows):
|
|||||||
{
|
{
|
||||||
"path": exe_path,
|
"path": exe_path,
|
||||||
"symlink": symlink,
|
"symlink": symlink,
|
||||||
"add_to_devenv_path": True,
|
"add_to_devenv_path": False,
|
||||||
"checksum": checksum,
|
"checksum": checksum,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -863,7 +863,7 @@ def get_manifest(is_windows):
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
label = "NodeJS"
|
label = "NodeJS"
|
||||||
version = "16.19.0"
|
version = "24.12.0"
|
||||||
download_url = ""
|
download_url = ""
|
||||||
download_checksum = ""
|
download_checksum = ""
|
||||||
exe_path = ""
|
exe_path = ""
|
||||||
@@ -873,13 +873,13 @@ def get_manifest(is_windows):
|
|||||||
|
|
||||||
if is_windows:
|
if is_windows:
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
||||||
download_checksum = "e07399a4a441091ca0a5506faf7a9236ea1675220146daeea3bee828c2cbda3f"
|
download_checksum = "8d41356abf5cb62404f311f131b7937f45aaeda5c15d060dc281c2ece817cdce"
|
||||||
checksum = "e4e7f389fbec9300275defc749246c62bdbe4f66406eb01e7c9a4101e07352da"
|
checksum = "2ffe3acc0458fdde999f50d11809bbe7c9b7ef204dcf17094e325d26ace101d8"
|
||||||
exe_path = "node.exe"
|
exe_path = "node.exe"
|
||||||
else:
|
else:
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
||||||
download_checksum = "c88b52497ab38a3ddf526e5b46a41270320409109c3f74171b241132984fd08f"
|
download_checksum = "bdebee276e58d0ef5448f3d5ac12c67daa963dd5e0a9bb621a53d1cefbc852fd"
|
||||||
checksum = "45afcfc9a45df626e8aa2b883753d1cf7f222ad9243f3003d1aa372696120df6"
|
checksum = "16143bdaa79716e871d3d9b2f50ce680bca293eba7f0c3fc1d004ed2258fc839"
|
||||||
exe_path = "bin/node"
|
exe_path = "bin/node"
|
||||||
|
|
||||||
result.append({
|
result.append({
|
||||||
@@ -903,204 +903,6 @@ def get_manifest(is_windows):
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
version = "20.18.2"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "06e72c0f78cc1bf1819eb0a0a37001d2917f19ad46a149c2f923c901f599ba52"
|
|
||||||
checksum = "8487a277e92282904dfe0f860dbd5d229543e97a858a223fbe9c9b8670bbe170"
|
|
||||||
add_to_devenv_script = [ ]
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "4e50f727ae09bdafecf2322c72faf7cd82bf3b8851a16b8bb63974e0d8d6eceb"
|
|
||||||
checksum = "7109816761936af63cec42b03ce74ff8c0979161a3f97952984aa1be75e40233"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
version = "20.12.2"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "66dda1717cae30a13be6bb17ad96ee54b69f2c23c85acd9c3299b095fa26b452"
|
|
||||||
checksum = "d2cfb2cd6cf37c3a654964f01c1333d5692907d20ca172dfb37025114af742e9"
|
|
||||||
add_to_devenv_script = [ ]
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "595272130310cbe12301430756f23d153f7ab95d00174c02adc11a2e3703d183"
|
|
||||||
checksum = "0652a7596fd240292d603220c18afd94e60d2280a58d0a2f0571ca48f20fa04f"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
version = "18.15.0"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "cad3cc0910dc216e8b6dcfc3c5b3be0a619c2d4a4b29f2e674820b70e4f374dd"
|
|
||||||
checksum = "17fd75d8a41bf9b4c475143e19ff2808afa7a92f7502ede731537d9da674d5e8"
|
|
||||||
add_to_devenv_script = [
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "c8c5fa53ce0c0f248e45983e86368e0b1daf84b77e88b310f769c3cfc12682ef"
|
|
||||||
checksum = "a2a40807f57c1c215ddb996e71e4f30b93e375cab2bfb725287b8a1f51fd1e7a"
|
|
||||||
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
version = "12.22.12"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "95f969cafbe02eb91e9d375899518b8e517f9f16300d040ac89fdaf4b881ba8d"
|
|
||||||
checksum = "b014e4ec5ca810b2fb54cdbf6ab8d6acc488285c98469606efb8b412472bec2a"
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "e6d052364bfa2c17da92cf31794100cfd709ba147415ddaeed2222eec9ca1469"
|
|
||||||
checksum = "5a3c51dbee8fdd7201fe7b531f03262754b9b9fb1008f4c824e8d649c4e9c96b"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
version = "22.12.0"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "922285593360adbe1fcd16d4e0049a13552dcad085fa53768c21c8d17089a134"
|
|
||||||
checksum = "b3b117a08ee61efee09e6fd523ab33c0c018da1b570bde08e4fd914dc1170ed6"
|
|
||||||
add_to_devenv_script = [ ]
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "22982235e1b71fa8850f82edd09cdae7e3f32df1764a9ec298c72d25ef2c164f"
|
|
||||||
checksum = "177208bfc4a9403121a40c72d038c670f4fd937fa16ca7df0a720e90be0fe2d9"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": True,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
version = "23.5.0"
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
|
|
||||||
download_checksum = "4d86167dd98801c723a13e65519822d409b603acbec9b0d1107a4ad8578a7c53"
|
|
||||||
checksum = "0f91994f833bc232c990fee8694ca00d4d60c67f6cd0f7f0633c9abc34c91888"
|
|
||||||
add_to_devenv_script = [
|
|
||||||
f"set PATH=%~dp0{label}\\{version}\\node_modules\\corepack\\shims;%PATH%",
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
|
|
||||||
download_checksum = "f3c02df735945267f886f3ea6f7e28d4bb33fe36e12bec77d10b9fa6a12c6279"
|
|
||||||
checksum = "53e6a056575aa6338e3e4691f1c4539d67bd1c85d3927c3ea603a0dccca741b8"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "NodeJS",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"download_url": download_url,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": True,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": add_to_devenv_script,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
label = "Python"
|
label = "Python"
|
||||||
@@ -1353,7 +1155,7 @@ def get_manifest(is_windows):
|
|||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
version = "0.11.3"
|
version = "0.12.1"
|
||||||
download_url = ""
|
download_url = ""
|
||||||
download_checksum = ""
|
download_checksum = ""
|
||||||
exe_path = ""
|
exe_path = ""
|
||||||
@@ -1362,13 +1164,13 @@ def get_manifest(is_windows):
|
|||||||
|
|
||||||
if is_windows:
|
if is_windows:
|
||||||
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/nvim-win64.zip"
|
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/nvim-win64.zip"
|
||||||
download_checksum = "7fc50d8d113a4a88e78138db8384629e6ebaa739e6d43adf74b4ed51cb22ee04"
|
download_checksum = "75fedc530b3772ca9f177edc7db92560bb9d2d6700ac6d5b2c53eaf5a9317ae3"
|
||||||
checksum = "0c0aa21c521b63c5c981cf5e4b2e6d73b26dde6778902fa901c5ee194da61f91"
|
checksum = "10ea3c95e5638e88c232fde281043cbd3482f6b4a9fe100d31e6d42f614b4bc1"
|
||||||
exe_path = "bin/nvim.exe"
|
exe_path = "bin/nvim.exe"
|
||||||
else:
|
else:
|
||||||
exe_path = "nvim-linux-x86_64.appimage"
|
exe_path = "nvim-linux-x86_64.appimage"
|
||||||
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/{exe_path}"
|
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/{exe_path}"
|
||||||
download_checksum = "5f377dc48c49a4170bd698a80ef461a702b8ebb8b2f7ddbb776341503d36415f"
|
download_checksum = "022e6e7eb79939813fa895ad39aa7dcaa10bb9c20ed234d5752fe12845df27db"
|
||||||
checksum = download_checksum
|
checksum = download_checksum
|
||||||
symlink = ["nvim", "vim"] # Usually use VM with no desktop-environment
|
symlink = ["nvim", "vim"] # Usually use VM with no desktop-environment
|
||||||
|
|
||||||
@@ -1395,7 +1197,7 @@ def get_manifest(is_windows):
|
|||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
version = "0.15.0"
|
version = "0.16.2"
|
||||||
download_url = ""
|
download_url = ""
|
||||||
download_checksum = ""
|
download_checksum = ""
|
||||||
exe_path = ""
|
exe_path = ""
|
||||||
@@ -1403,12 +1205,12 @@ def get_manifest(is_windows):
|
|||||||
|
|
||||||
if is_windows:
|
if is_windows:
|
||||||
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.exe.zip"
|
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.exe.zip"
|
||||||
download_checksum = "bec596a700acb4e88333404d91503669201bc269e1c7d40ebd4f0332a7b5bfaa"
|
download_checksum = "d1e071d8bf676a500988820b852843e811fc8355396ce72e8f4c7ed2c744e2e2"
|
||||||
checksum = "d9ba5957edafbce84292f703351ae4d2e840ac53a12dd0fd85b2492bc56126b1"
|
checksum = "b6b20dfc2d4fd7eb584fee46c7f6d4fd64c1ffaa2fcbf668f51e2d1a35d06f6a"
|
||||||
exe_path = "neovide.exe"
|
exe_path = "neovide.exe"
|
||||||
else:
|
else:
|
||||||
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.AppImage"
|
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.AppImage"
|
||||||
download_checksum = "c24785582e9da352bdc001381ef3254869af15e1f7f940a8602fa7b47a543b18"
|
download_checksum = "ef617c743d7425267ac3ae2f1761ac8fc801683bd3e013758eb68247a53c6812"
|
||||||
checksum = download_checksum
|
checksum = download_checksum
|
||||||
exe_path = "neovide.AppImage"
|
exe_path = "neovide.AppImage"
|
||||||
|
|
||||||
|
|||||||
@@ -1,336 +0,0 @@
|
|||||||
def get_manifest(is_windows):
|
|
||||||
result = []
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "1.4.1.1024"
|
|
||||||
result.append({
|
|
||||||
"label": "Everything",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://www.voidtools.com/Everything-{version}.x64.zip",
|
|
||||||
"download_checksum": "4be0851752e195c9c7f707b1e0905cd01caf6208f4e2bfa2a66e43c0837be8f5",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "Everything.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "35cefe4bc4a98ad73dda4444c700aac9f749efde8f9de6a643a57a5b605bd4e7",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "22.3"
|
|
||||||
result.append({
|
|
||||||
"label": "MobaXTerm",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://download.mobatek.net/2232022120824733/MobaXterm_Portable_v{version}.zip",
|
|
||||||
"download_checksum": "c8de508d6731f31a73f061e58942691466d1d24cfa941e642e16e0930be2fad9",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": f"MobaXterm_Personal_{version}.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "e47cb54645a368411c5d6b6cbfa7e25980a2a674d7d0c082f5137b6e77a2f362",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "3.0.7039"
|
|
||||||
result.append({
|
|
||||||
"label": "SystemInformer",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://github.com/winsiderss/si-builds/releases/download/{version}/systeminformer-{version}-bin.zip",
|
|
||||||
"download_checksum": "4557e58f698048e882515faac89c9c7f654247dbf4bd656ceed5c3f97afef77d",
|
|
||||||
"version": "3.0.5847",
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "amd64/SystemInformer.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "8a6e9dfd145e5cb8d03ec3db1b7b0163325be33e5c8fdd4126e9f8df2af2a39c",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
version = "2.0.0"
|
|
||||||
download_url = ""
|
|
||||||
download_checksum = ""
|
|
||||||
exe_path = ""
|
|
||||||
checksum = ""
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://github.com/ahrm/sioyek/releases/download/v{version}/sioyek-release-windows-portable.zip"
|
|
||||||
download_checksum = "1f4fedbb38c0dc46bbba4bb95d0d6fab39fcf3525092ac26d92c891684d2bf8d"
|
|
||||||
checksum = "6c660f0f7265fabe6d943d15d9b5c7e85f2dbcf7fecb7d2cd0639e7086b1c034"
|
|
||||||
exe_path = "sioyek.exe"
|
|
||||||
else:
|
|
||||||
download_url = f"https://github.com/ahrm/sioyek/releases/download/v{version}/sioyek-release-linux-portable.zip"
|
|
||||||
download_checksum = "3f90659c1f29705de680b3607ae247582eab8860015c208d364a0f3fc15d3222"
|
|
||||||
checksum = "7abc12e8fe71b0285e067866bcea2ea0e025e37291f6bce450675a567172e44f"
|
|
||||||
exe_path = "Sioyek-x86_64.AppImage"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "Sioyek",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": download_url,
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "4_15"
|
|
||||||
result.append({
|
|
||||||
"label": "WizTree",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://www.diskanalyzer.com/files/wiztree_{version}_portable.zip",
|
|
||||||
"download_checksum": "dfa135cf5f87317ebe6112b7c8453f9eed5d93b78e9040a0ec882cbd6b200a95",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "WizTree64.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "141d7b51dbef71205f808e87b5e2d85a75eac69d060f678db628be2a0984a929",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "1.64.0"
|
|
||||||
result.append({
|
|
||||||
"label": "RClone",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://github.com/rclone/rclone/releases/download/v{version}/rclone-v{version}-windows-amd64.zip",
|
|
||||||
"download_checksum": "b1251cfdcbc44356e001057524c3e2f7be56d94546273d10143bfa1148c155ab",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "rclone.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "64e0322e3bec6fb9fa730b7a14106e1e59fa186096f9a8d433a5324eb6853e01",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "1.5.3"
|
|
||||||
result.append({
|
|
||||||
"label": "Eyes-Thanks",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://github.com/yalov/eyes-thanks/releases/download/{version}/EyesThanks_v{version}.zip",
|
|
||||||
"download_checksum": "6ab2b20730f56aa54263eb942be8849f52f9cba26438aee3c1b01103069411cc",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "Eyes' Thanks.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "48d232bd4a302b11378791eee844b42a2e30fe3553acf17a3b9e8ee0fcf27766",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
version = "15.0.0"
|
|
||||||
result.append({
|
|
||||||
"label": "ShareX",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": f"https://github.com/ShareX/ShareX/releases/download/v{version}/ShareX-{version}-portable.zip",
|
|
||||||
"download_checksum": "c3bc97e9fb8d107e92cb494b50f842fccafbc9fd810588a1b635aee4dbe90bc1",
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": "ShareX.exe",
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": "0b679c46c2940edc09cff8ae0b0f4578aeda0346b9c402276b166aee4ec864be",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
version = "0.12"
|
|
||||||
download_url = ""
|
|
||||||
download_checksum = ""
|
|
||||||
exe_path = ""
|
|
||||||
checksum = ""
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://bitbucket.org/heldercorreia/speedcrunch/downloads/SpeedCrunch-{version}-win32.zip"
|
|
||||||
download_checksum = "024362bccd7908b508192cd90c2f6a716b5aa4fa5c7ff2aea9a1bf49d6580175"
|
|
||||||
checksum = "c80409586d6b36d315ce9462fd9020a12b07633a569d94a8ee057bcd18ee5647"
|
|
||||||
exe_path = "speedcrunch.exe"
|
|
||||||
else:
|
|
||||||
download_url = f"https://bitbucket.org/heldercorreia/speedcrunch/downloads/SpeedCrunch-{version}-linux64.tar.bz2"
|
|
||||||
download_checksum = "9347bef2068053ad15c5914ee147bf11a1ccb1d30cb18d63d0178380c327e8fc"
|
|
||||||
checksum = "06c7e7f68027f133dc7874f663873244b695c8a7d2aec9cde0e40b7a5b9a4db1"
|
|
||||||
exe_path = "speedcrunch"
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "SpeedCrunch",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": download_url,
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
version = "2.7.6"
|
|
||||||
download_url = ""
|
|
||||||
download_checksum = ""
|
|
||||||
exe_path = ""
|
|
||||||
checksum = ""
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
download_url = f"https://github.com/keepassxreboot/keepassxc/releases/download/{version}/KeePassXC-{version}-Win64.zip"
|
|
||||||
download_checksum = "42aed8fee2b5fbc7ecae4494c274aece35f3de57c4370c1cd0eb365e501fb4c6"
|
|
||||||
checksum = "915f6879ca20fc7ffd196402e301676c3bd04419ee90486cbd56662dbb7d0b77"
|
|
||||||
exe_path = "KeePassXC.exe"
|
|
||||||
else:
|
|
||||||
exe_path = f"KeePassXC-{version}-x86_64.AppImage"
|
|
||||||
download_url = f"https://github.com/keepassxreboot/keepassxc/releases/download/{version}/{exe_path}"
|
|
||||||
download_checksum = "f32f7e7ab4bca789b24bd6a420c1d87dff40982646abef58fca481a7c56ace48"
|
|
||||||
checksum = download_checksum
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "KeePassXC",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": download_url,
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": [],
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
version = "3.56.0"
|
|
||||||
symlink = []
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
exe_path = "LosslessCut.exe"
|
|
||||||
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/LosslessCut-win-x64.7z"
|
|
||||||
download_checksum = "4dbbad634a09d16fd2cb53461ca8b7b5e8506fdaf03f811233646493b3fe04c0"
|
|
||||||
checksum = "14452473962369dd3443976dab7dc15a6fbbb60a6c758e8b95337ed161648a5a"
|
|
||||||
else:
|
|
||||||
exe_path = f"LosslessCut-linux-x86_64.AppImage"
|
|
||||||
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/{exe_path}"
|
|
||||||
download_checksum = ""
|
|
||||||
checksum = download_checksum
|
|
||||||
|
|
||||||
result.append({
|
|
||||||
"label": "LosslessCut",
|
|
||||||
"manifests": [
|
|
||||||
{
|
|
||||||
"download_url": download_url,
|
|
||||||
"download_checksum": download_checksum,
|
|
||||||
"version": version,
|
|
||||||
"unzip_method": 'default',
|
|
||||||
"executables": [
|
|
||||||
{
|
|
||||||
"path": exe_path,
|
|
||||||
"symlink": symlink,
|
|
||||||
"add_to_devenv_path": False,
|
|
||||||
"checksum": checksum,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"add_to_devenv_script": [],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
return result
|
|
||||||
+22
-36
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# DEVenver
|
# DEVenver
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# A simple python script to download portable applications and install them by
|
# A simple python script to download portable applications and install them by
|
||||||
# unzipping them to a structured directory tree.
|
# unzipping them to a structured directory tree.
|
||||||
|
|
||||||
@@ -22,11 +21,8 @@ from string import Template
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
# Internal
|
# Internal
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
DOWNLOAD_CHUNK_SIZE = 1 * 1024 * 1024 # 1 megabyte
|
DOWNLOAD_CHUNK_SIZE = 1 * 1024 * 1024 # 1 megabyte
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# These variables are set once they are downloaded dynamically and installed
|
# These variables are set once they are downloaded dynamically and installed
|
||||||
# from the internal app listing!
|
# from the internal app listing!
|
||||||
zstd_exe = ""
|
zstd_exe = ""
|
||||||
@@ -34,7 +30,6 @@ zip7_exe = ""
|
|||||||
zip7_bootstrap_exe = ""
|
zip7_bootstrap_exe = ""
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
def print_header(title):
|
def print_header(title):
|
||||||
line = f'> ' + title + ' ';
|
line = f'> ' + title + ' ';
|
||||||
print(line.ljust(100, '-'))
|
print(line.ljust(100, '-'))
|
||||||
@@ -143,9 +138,6 @@ def get_exe_install_path(install_dir, label, version_label, exe_rel_path):
|
|||||||
result = pathlib.Path(install_dir, exe_rel_path)
|
result = pathlib.Path(install_dir, exe_rel_path)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get_exe_symlink_dir(install_dir):
|
|
||||||
result = pathlib.Path(install_dir, "Symlinks")
|
|
||||||
return result
|
|
||||||
|
|
||||||
def download_and_install_archive(download_url,
|
def download_and_install_archive(download_url,
|
||||||
download_checksum,
|
download_checksum,
|
||||||
@@ -382,7 +374,7 @@ def download_and_install_archive(download_url,
|
|||||||
|
|
||||||
# Do the symlinks
|
# Do the symlinks
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
symlink_dir = get_exe_symlink_dir(install_dir)
|
symlink_dir = install_dir
|
||||||
paths_to_add_to_devenv_script = set()
|
paths_to_add_to_devenv_script = set()
|
||||||
for exe_dict in exe_list:
|
for exe_dict in exe_list:
|
||||||
exe_rel_path = exe_dict['path']
|
exe_rel_path = exe_dict['path']
|
||||||
@@ -404,8 +396,11 @@ def download_and_install_archive(download_url,
|
|||||||
# OS.
|
# OS.
|
||||||
use_hardlink = is_windows or os.name == 'nt'
|
use_hardlink = is_windows or os.name == 'nt'
|
||||||
for symlink_entry in exe_dict["symlink"]:
|
for symlink_entry in exe_dict["symlink"]:
|
||||||
symlink_dest = symlink_dir / symlink_entry
|
symlink_dest = symlink_dir / symlink_entry
|
||||||
symlink_src = exe_path
|
symlink_src = exe_path
|
||||||
|
symlink_rel_src = pathlib.Path(symlink_src).relative_to(install_dir)
|
||||||
|
symlink_rel_dest = pathlib.Path(symlink_dest).relative_to(install_dir)
|
||||||
|
|
||||||
skip_link = False;
|
skip_link = False;
|
||||||
if os.path.exists(symlink_dest):
|
if os.path.exists(symlink_dest):
|
||||||
# Windows uses hardlinks because symlinks require you to enable "developer" mode
|
# Windows uses hardlinks because symlinks require you to enable "developer" mode
|
||||||
@@ -422,11 +417,13 @@ def download_and_install_archive(download_url,
|
|||||||
else:
|
else:
|
||||||
os.unlink(symlink_dest)
|
os.unlink(symlink_dest)
|
||||||
|
|
||||||
|
import contextlib
|
||||||
if not skip_link:
|
if not skip_link:
|
||||||
if use_hardlink:
|
if use_hardlink:
|
||||||
os.link(src=symlink_src, dst=symlink_dest)
|
os.link(src=symlink_src, dst=symlink_dest)
|
||||||
else:
|
else:
|
||||||
os.symlink(src=symlink_src, dst=symlink_dest)
|
with contextlib.chdir(install_dir):
|
||||||
|
os.symlink(src=symlink_rel_src, dst=symlink_dest)
|
||||||
|
|
||||||
# Collect paths to add to the devenv script
|
# Collect paths to add to the devenv script
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
@@ -516,7 +513,7 @@ internal_app_list = []
|
|||||||
devenv_script_buffer = ""
|
devenv_script_buffer = ""
|
||||||
|
|
||||||
def install_app_list(app_list, download_dir, install_dir, is_windows):
|
def install_app_list(app_list, download_dir, install_dir, is_windows):
|
||||||
title = "Internal Apps" if app_list is internal_app_list else "User Apps"
|
title = "Internal Apps"
|
||||||
print_header(title)
|
print_header(title)
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
@@ -775,7 +772,6 @@ def run(user_app_list,
|
|||||||
# Create the paths requested by the user
|
# Create the paths requested by the user
|
||||||
os.makedirs(download_dir, exist_ok=True)
|
os.makedirs(download_dir, exist_ok=True)
|
||||||
os.makedirs(install_dir, exist_ok=True)
|
os.makedirs(install_dir, exist_ok=True)
|
||||||
os.makedirs(pathlib.Path(install_dir, "Symlinks"), exist_ok=True)
|
|
||||||
|
|
||||||
for path in [download_dir, install_dir]:
|
for path in [download_dir, install_dir]:
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
@@ -797,10 +793,10 @@ def run(user_app_list,
|
|||||||
install_dir=install_dir,
|
install_dir=install_dir,
|
||||||
is_windows=is_windows)
|
is_windows=is_windows)
|
||||||
|
|
||||||
user_apps = install_app_list(app_list=user_app_list,
|
user_apps = install_app_list(app_list=user_app_list,
|
||||||
download_dir=download_dir,
|
download_dir=download_dir,
|
||||||
install_dir=install_dir,
|
install_dir=install_dir,
|
||||||
is_windows=is_windows)
|
is_windows=is_windows)
|
||||||
|
|
||||||
# Write the devenv script with environment variables
|
# Write the devenv script with environment variables
|
||||||
if is_windows:
|
if is_windows:
|
||||||
@@ -808,32 +804,22 @@ def run(user_app_list,
|
|||||||
devenv_script_buffer += "set devenver_root=%devenver_root_backslash:~0,-1%\n"
|
devenv_script_buffer += "set devenver_root=%devenver_root_backslash:~0,-1%\n"
|
||||||
devenv_script_buffer += "set devenver_root_backslash=\n"
|
devenv_script_buffer += "set devenver_root_backslash=\n"
|
||||||
|
|
||||||
devenv_script_buffer += "set path=%~dp0Symlinks;%PATH%\n"
|
devenv_script_buffer += "set path=%~dp0;%PATH%\n"
|
||||||
devenv_script_buffer += "set path=%~dp0Scripts;%PATH%\n"
|
|
||||||
else:
|
else:
|
||||||
devenv_script_buffer += f"export devenver_root=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )\"\n"
|
devenv_script_buffer += f"export devenver_root=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )\"\n"
|
||||||
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Scripts\":$PATH\n"
|
devenv_script_buffer += f'PATH="$( cd -- $( dirname -- "${{BASH_SOURCE[0]}}" ) &> /dev/null && pwd )":$PATH\n'
|
||||||
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
|
|
||||||
devenv_script_buffer += f"PATH=$(echo $PATH | awk -v RS=: -v ORS=: '/^\/mnt\/c/ {{next}} {{print}}')\n"
|
devenv_script_buffer += f"PATH=$(echo $PATH | awk -v RS=: -v ORS=: '/^\/mnt\/c/ {{next}} {{print}}')\n"
|
||||||
devenv_script_buffer += f"source $devenver_root/unix_fzf-completion.bash\n"
|
devenv_script_buffer += f"source $devenver_root/unix_fzf-completion.bash\n"
|
||||||
devenv_script_buffer += f"source $devenver_root/unix_fzf-key-bindings.bash\n"
|
devenv_script_buffer += f"source $devenver_root/unix_fzf-key-bindings.bash\n"
|
||||||
|
|
||||||
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
|
if devenv_script_name:
|
||||||
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)
|
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
|
||||||
|
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)
|
||||||
lprint(f"Writing script to augment the environment with installed applications: {devenv_script_path}")
|
lprint(f"Writing script to augment the environment with installed applications: {devenv_script_path}")
|
||||||
devenv_script_path.write_text(devenv_script_buffer)
|
devenv_script_path.write_text(devenv_script_buffer)
|
||||||
|
|
||||||
if not is_windows:
|
if not is_windows:
|
||||||
subprocess.run(args=["chmod", "+x", devenv_script_path])
|
subprocess.run(args=["chmod", "+x", devenv_script_path])
|
||||||
|
|
||||||
# Merge the install dictionaries, this dictionary contains
|
result = {**internal_apps, **user_apps}
|
||||||
# (app label) -> [array of installed versions]
|
|
||||||
result = internal_apps
|
|
||||||
for key, value in user_apps.items():
|
|
||||||
if key not in result:
|
|
||||||
result.update({key: value})
|
|
||||||
else:
|
|
||||||
result[key] += value
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
+144
-197
@@ -8,9 +8,7 @@ import shutil
|
|||||||
import tempfile
|
import tempfile
|
||||||
import argparse
|
import argparse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
import app_manifest_dev
|
import app_manifest_dev
|
||||||
import app_manifest_user
|
|
||||||
|
|
||||||
def git_clone(install_dir, git_exe, url, commit_hash):
|
def git_clone(install_dir, git_exe, url, commit_hash):
|
||||||
devenver.lprint(f"Git clone {url} to {install_dir}", level=0)
|
devenver.lprint(f"Git clone {url} to {install_dir}", level=0)
|
||||||
@@ -46,16 +44,6 @@ arg_parser.add_argument('--install-dir',
|
|||||||
default="",
|
default="",
|
||||||
type=pathlib.Path)
|
type=pathlib.Path)
|
||||||
|
|
||||||
arg_parser.add_argument('--with-dev-apps',
|
|
||||||
help=f'Download and install apps from the developer manifest',
|
|
||||||
const=True,
|
|
||||||
action="store_const")
|
|
||||||
|
|
||||||
arg_parser.add_argument('--with-user-apps',
|
|
||||||
help=f'Download and install apps from the user manifest',
|
|
||||||
const=True,
|
|
||||||
action="store_const")
|
|
||||||
|
|
||||||
arg_parser.add_argument('operating_system',
|
arg_parser.add_argument('operating_system',
|
||||||
choices=['win', 'linux'],
|
choices=['win', 'linux'],
|
||||||
help=f'Download and install apps for the specified operating system')
|
help=f'Download and install apps for the specified operating system')
|
||||||
@@ -75,71 +63,47 @@ if install_dir == pathlib.Path(""):
|
|||||||
install_dir = devenver.script_dir / 'Linux'
|
install_dir = devenver.script_dir / 'Linux'
|
||||||
|
|
||||||
# Install development apps
|
# Install development apps
|
||||||
# ------------------------------------------------------------------------------
|
dev_env_script_name = "dev_env"
|
||||||
if args.with_dev_apps:
|
app_list = app_manifest_dev.get_manifest(is_windows=is_windows)
|
||||||
# Run DEVenver, installing the portable apps
|
installed_dev_apps = devenver.run(user_app_list=app_list,
|
||||||
# --------------------------------------------------------------------------
|
download_dir=download_dir,
|
||||||
dev_env_script_name = "dev_env"
|
install_dir=install_dir,
|
||||||
app_list = app_manifest_dev.get_manifest(is_windows=is_windows)
|
devenv_script_name=dev_env_script_name,
|
||||||
installed_dev_apps = devenver.run(user_app_list=app_list,
|
is_windows=is_windows)
|
||||||
download_dir=download_dir,
|
install_script_path = pathlib.Path(devenver.script_dir, "install.py")
|
||||||
install_dir=install_dir,
|
|
||||||
devenv_script_name=dev_env_script_name,
|
|
||||||
is_windows=is_windows)
|
|
||||||
|
|
||||||
|
if is_windows:
|
||||||
|
# Install apps dependent on Git
|
||||||
|
devenver.print_header("Install apps that rely on Git")
|
||||||
|
git_exe = installed_dev_apps["Git"][0]['exe_path']
|
||||||
|
|
||||||
install_script_path = pathlib.Path(devenver.script_dir, "install.py")
|
# Clink
|
||||||
if is_windows:
|
clink_install_dir = installed_dev_apps["Clink"][0]['install_dir']
|
||||||
# Install apps dependent on Git
|
clink_base_dir = clink_install_dir.parent
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
devenver.print_header("Install apps that rely on Git")
|
|
||||||
git_exe = installed_dev_apps["Git"][0]['exe_path']
|
|
||||||
|
|
||||||
# Clink
|
# Gizmos
|
||||||
# --------------------------------------------------------------------------
|
clink_gizmo_git_hash = "fb2edd9"
|
||||||
clink_install_dir = installed_dev_apps["Clink"][0]['install_dir']
|
clink_gizmo_install_dir = clink_base_dir / "clink-gizmos"
|
||||||
clink_base_dir = clink_install_dir.parent
|
git_clone(install_dir=clink_gizmo_install_dir,
|
||||||
|
git_exe=git_exe,
|
||||||
|
url="https://github.com/chrisant996/clink-gizmos",
|
||||||
|
commit_hash=clink_gizmo_git_hash)
|
||||||
|
|
||||||
# Gizmos
|
# Completions
|
||||||
clink_gizmo_git_hash = "fb2edd9"
|
clink_completions_git_hash = "86b6f07"
|
||||||
clink_gizmo_install_dir = clink_base_dir / "clink-gizmos"
|
clink_completions_install_dir = clink_base_dir / "clink-completions"
|
||||||
git_clone(install_dir=clink_gizmo_install_dir,
|
git_clone(install_dir=clink_completions_install_dir,
|
||||||
git_exe=git_exe,
|
git_exe=git_exe,
|
||||||
url="https://github.com/chrisant996/clink-gizmos",
|
url="https://github.com/vladimir-kotikov/clink-completions",
|
||||||
commit_hash=clink_gizmo_git_hash)
|
commit_hash=clink_completions_git_hash)
|
||||||
|
|
||||||
# Completions
|
# Install clink configuration
|
||||||
clink_completions_git_hash = "86b6f07"
|
clink_profile_dir = clink_base_dir / "profile"
|
||||||
clink_completions_install_dir = clink_base_dir / "clink-completions"
|
clink_settings_path = clink_profile_dir / "clink_settings"
|
||||||
git_clone(install_dir=clink_completions_install_dir,
|
devenver.lprint(f"Installing clink_settings to: {clink_settings_path}")
|
||||||
git_exe=git_exe,
|
|
||||||
url="https://github.com/vladimir-kotikov/clink-completions",
|
|
||||||
commit_hash=clink_completions_git_hash)
|
|
||||||
|
|
||||||
# Odin
|
clink_settings_path.parent.mkdir(exist_ok=True)
|
||||||
# --------------------------------------------------------------------------
|
clink_settings_path.write_text(f"""# When this file is named "default_settings" and is in the binaries
|
||||||
# odin_git_hash = "9ae1bfb6"
|
|
||||||
# odin_install_dir = install_dir / "Odin"
|
|
||||||
# git_clone(install_dir=odin_install_dir,
|
|
||||||
# git_exe=git_exe,
|
|
||||||
# url="https://github.com/odin-lang/odin.git",
|
|
||||||
# commit_hash=odin_git_hash)
|
|
||||||
|
|
||||||
# TODO: We can't do this yet because the odin build requires a registry hack so
|
|
||||||
# that it knows where to find MSVC.
|
|
||||||
|
|
||||||
# Build Odin
|
|
||||||
# subprocess.run(f"{git_exe} checkout {odin_git_hash}",
|
|
||||||
# cwd=odin_install_dir)
|
|
||||||
|
|
||||||
# Install clink configuration
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
clink_profile_dir = clink_base_dir / "profile"
|
|
||||||
clink_settings_path = clink_profile_dir / "clink_settings"
|
|
||||||
devenver.lprint(f"Installing clink_settings to: {clink_settings_path}")
|
|
||||||
|
|
||||||
clink_settings_path.parent.mkdir(exist_ok=True)
|
|
||||||
clink_settings_path.write_text(f"""# When this file is named "default_settings" and is in the binaries
|
|
||||||
# directory or profile directory, it provides enhanced default settings.
|
# directory or profile directory, it provides enhanced default settings.
|
||||||
|
|
||||||
# Override built-in default settings with ones that provide a more
|
# Override built-in default settings with ones that provide a more
|
||||||
@@ -177,161 +141,144 @@ clink.path = {clink_completions_install_dir};{clink_gizmo
|
|||||||
fzf.default_bindings = True
|
fzf.default_bindings = True
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Install wezterm configuration
|
# Install wezterm configuration
|
||||||
# --------------------------------------------------------------------------
|
wezterm_config_dest_path = installed_dev_apps["WezTerm"][0]["install_dir"] / "wezterm.lua"
|
||||||
wezterm_config_dest_path = installed_dev_apps["WezTerm"][0]["install_dir"] / "wezterm.lua"
|
devenver.lprint(f"Installing WezTerm config to {wezterm_config_dest_path}")
|
||||||
devenver.lprint(f"Installing WezTerm config to {wezterm_config_dest_path}")
|
|
||||||
|
|
||||||
clink_exe_path = clink_install_dir.relative_to(install_dir) / "clink_x64.exe"
|
clink_exe_path = clink_install_dir.relative_to(install_dir) / "clink_x64.exe"
|
||||||
clink_exe_path_for_wezterm = str(clink_exe_path).replace("\\", "\\\\")
|
clink_exe_path_for_wezterm = str(clink_exe_path).replace("\\", "\\\\")
|
||||||
clink_profile_path_for_wezterm = str(clink_profile_dir.relative_to(install_dir)).replace("\\", "\\\\")
|
clink_profile_path_for_wezterm = str(clink_profile_dir.relative_to(install_dir)).replace("\\", "\\\\")
|
||||||
|
|
||||||
wezterm_config_dest_path.write_text(f"""local wezterm = require 'wezterm';
|
wezterm_config_dest_path.write_text(f"""local wezterm = require 'wezterm';
|
||||||
|
|
||||||
local default_prog
|
local default_prog
|
||||||
local set_environment_variables = {{}}
|
local set_environment_variables = {{}}
|
||||||
|
|
||||||
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
|
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
|
||||||
|
|
||||||
clink_exe = string.format("%s\\\\..\\\\..\\\\{clink_exe_path_for_wezterm}", wezterm.executable_dir)
|
clink_exe = string.format("%s\\\\..\\\\..\\\\{clink_exe_path_for_wezterm}", wezterm.executable_dir)
|
||||||
devenv_bat = string.format("%s\\\\..\\\\..\\\\{dev_env_script_name}.bat", wezterm.executable_dir)
|
devenv_bat = string.format("%s\\\\..\\\\..\\\\{dev_env_script_name}.bat", wezterm.executable_dir)
|
||||||
clink_profile = string.format("%s\\\\..\\\\..\\\\{clink_profile_path_for_wezterm}", wezterm.executable_dir)
|
clink_profile = string.format("%s\\\\..\\\\..\\\\{clink_profile_path_for_wezterm}", wezterm.executable_dir)
|
||||||
|
|
||||||
-- Taken from: https://wezfurlong.org/wezterm/shell-integration.html
|
-- Taken from: https://wezfurlong.org/wezterm/shell-integration.html
|
||||||
-- Use OSC 7 as per the above example
|
-- Use OSC 7 as per the above example
|
||||||
set_environment_variables['prompt'] =
|
set_environment_variables['prompt'] =
|
||||||
'$E]7;file://localhost/$P$E\\\\$E[32m$T$E[0m $E[35m$P$E[36m$_$G$E[0m '
|
'$E]7;file://localhost/$P$E\\\\$E[32m$T$E[0m $E[35m$P$E[36m$_$G$E[0m '
|
||||||
|
|
||||||
default_prog = {{"cmd.exe", "/s", "/k",
|
default_prog = {{"cmd.exe", "/s", "/k",
|
||||||
clink_exe, "inject", "--profile", clink_profile, "-q",
|
clink_exe, "inject", "--profile", clink_profile, "-q",
|
||||||
"&&", "call", devenv_bat}}
|
"&&", "call", devenv_bat}}
|
||||||
end
|
end
|
||||||
|
|
||||||
return {{
|
return {{
|
||||||
font_size = 10.0,
|
font_size = 10.0,
|
||||||
color_scheme = "Peppermint",
|
color_scheme = "Peppermint",
|
||||||
default_prog = default_prog,
|
default_prog = default_prog,
|
||||||
set_environment_variables = set_environment_variables,
|
set_environment_variables = set_environment_variables,
|
||||||
prefer_egl = true,
|
|
||||||
}}
|
}}
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Wezterm super terminal
|
# Wezterm super terminal
|
||||||
# --------------------------------------------------------------------------
|
wezterm_terminal_script_path = install_dir / "dev_terminal.bat"
|
||||||
wezterm_terminal_script_path = install_dir / "dev_terminal.bat"
|
devenver.lprint(f"Installing WezTerm terminal script to {wezterm_terminal_script_path}")
|
||||||
devenver.lprint(f"Installing WezTerm terminal script to {wezterm_terminal_script_path}")
|
|
||||||
|
|
||||||
wezterm_terminal_script_path.write_text(f"""@echo off
|
wezterm_terminal_script_path.write_text(f"""@echo off
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
|
|
||||||
set working_dir=
|
set working_dir=
|
||||||
if "%~1" neq "" (
|
if "%~1" neq "" (
|
||||||
set working_dir=start --cwd "%~1"
|
set working_dir=start --cwd "%~1"
|
||||||
set working_dir=!working_dir:\=/!
|
set working_dir=!working_dir:\=/!
|
||||||
)
|
)
|
||||||
|
|
||||||
start "" /MAX "%~dp0{installed_dev_apps["WezTerm"][0]["exe_path"].relative_to(install_dir)}" !working_dir!
|
start "" /MAX "%~dp0{installed_dev_apps["WezTerm"][0]["exe_path"].relative_to(install_dir)}" !working_dir!
|
||||||
""")
|
""")
|
||||||
# Python
|
# Python
|
||||||
# --------------------------------------------------------------------------
|
python_exe_path = pathlib.Path(installed_dev_apps["Python"][0]['exe_path'])
|
||||||
# TODO: If I'm using the terminal that this script generates it will lock the
|
|
||||||
# executable and Python cannot open the file for verifying the SHA256.
|
|
||||||
|
|
||||||
python_exe_path = pathlib.Path(installed_dev_apps["Python"][0]['exe_path'])
|
# PyNvim
|
||||||
|
devenver.lprint(f"Installing PyNVIM")
|
||||||
|
subprocess.run(f"{python_exe_path} -m pip install pynvim")
|
||||||
|
|
||||||
# PyNvim
|
# Use LLVM script to fix up bloated installation
|
||||||
devenver.lprint(f"Installing PyNVIM")
|
# See: https://github.com/zufuliu/llvm-utils/blob/main/llvm/llvm-link.bat
|
||||||
subprocess.run(f"{python_exe_path} -m pip install pynvim")
|
internal_dir = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) / "Internal"
|
||||||
|
if is_windows:
|
||||||
|
devenver.print_header("Use LLVM utils script to slim installation size")
|
||||||
|
llvm_install_dir_set = set()
|
||||||
|
for entry in installed_dev_apps["LLVM"]:
|
||||||
|
llvm_install_dir_set.add(entry['install_dir'])
|
||||||
|
|
||||||
# Add update script
|
llvm_script_src_path = internal_dir / "win_llvm-link-ad01970-2022-08-29.bat"
|
||||||
python_rel_exe_path = pathlib.Path(python_exe_path).relative_to(install_dir)
|
for llvm_install_dir in llvm_install_dir_set:
|
||||||
python_install_dir = pathlib.Path(python_exe_path).parent.relative_to(install_dir)
|
llvm_script_dest_path = llvm_install_dir / "llvm-link.bat"
|
||||||
|
shutil.copy(llvm_script_src_path, llvm_script_dest_path)
|
||||||
|
subprocess.run(llvm_script_dest_path, cwd=llvm_install_dir)
|
||||||
|
os.remove(llvm_script_dest_path)
|
||||||
|
|
||||||
(install_dir / "dev_env_update.bat").write_text(f"""@echo off
|
# Install fzf scripts
|
||||||
setlocal EnableDelayedExpansion
|
if not is_windows:
|
||||||
set PYTHONHOME=%~dp0{python_install_dir}
|
shutil.copy(internal_dir / "unix_fzf-completion.bash", install_dir)
|
||||||
%~dp0{python_rel_exe_path} {install_script_path} --with-dev-apps win
|
shutil.copy(internal_dir / "unix_fzf-key-bindings.bash", install_dir)
|
||||||
pause
|
|
||||||
""")
|
|
||||||
|
|
||||||
(install_dir / "user_env_update.bat").write_text(f"""@echo off
|
# Install dev scripts
|
||||||
setlocal EnableDelayedExpansion
|
if is_windows:
|
||||||
set PYTHONHOME=%~dp0{python_install_dir}
|
shutil.copy(internal_dir / "win_dev.bat", install_dir / "dev.bat")
|
||||||
%~dp0{python_rel_exe_path} {install_script_path} --with-user-apps win
|
else:
|
||||||
pause
|
shutil.copy(internal_dir / "unix_dev.sh", install_dir / "dev.sh")
|
||||||
""")
|
subprocess.run(args=["chmod", "+x", install_dir / "dev.sh"])
|
||||||
|
|
||||||
|
# Install left-overs
|
||||||
|
devenver.print_header("Install configuration files")
|
||||||
|
|
||||||
|
# ClangFormat
|
||||||
|
clang_format_src_path = internal_dir / "os_clang_format_style_file"
|
||||||
|
clang_format_dest_path = install_dir / "_clang-format"
|
||||||
|
devenver.lprint(f"Copying clang-format file from {clang_format_src_path} to {clang_format_dest_path}")
|
||||||
|
shutil.copy(clang_format_src_path, clang_format_dest_path)
|
||||||
|
|
||||||
|
# Copy init.vim to NVIM directory
|
||||||
|
nvim_init_dir = ""
|
||||||
|
|
||||||
|
if is_windows:
|
||||||
|
nvim_init_dir = pathlib.Path(os.path.expanduser("~")) / "AppData" / "Local" / "nvim"
|
||||||
|
else:
|
||||||
|
nvim_init_dir = pathlib.Path(os.path.expanduser("~")) / ".config" / "nvim"
|
||||||
|
|
||||||
|
nvim_config_dest_path = nvim_init_dir / "init.lua"
|
||||||
|
nvim_config_src_path = internal_dir / "os_nvim_init.lua"
|
||||||
|
|
||||||
|
if os.path.exists(nvim_init_dir / "init.vim"):
|
||||||
|
pathlib.Path(nvim_init_dir / "init.vim").unlink()
|
||||||
|
|
||||||
|
devenver.lprint(f"Installing NVIM config to {nvim_config_dest_path}")
|
||||||
|
nvim_init_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
shutil.copy(nvim_config_src_path, nvim_config_dest_path)
|
||||||
|
|
||||||
|
# Download vim.plug to NVIM init directory
|
||||||
|
nvim_plug_vim_dir = nvim_init_dir / "autoload"
|
||||||
|
nvim_plug_vim_path = nvim_plug_vim_dir / "plug.vim"
|
||||||
|
nvim_plug_vim_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
if not os.path.exists(nvim_plug_vim_path):
|
||||||
|
devenver.lprint(f"Installing NVIM plugin manager to {nvim_plug_vim_path}")
|
||||||
|
urllib.request.urlretrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim", nvim_plug_vim_path)
|
||||||
|
|
||||||
|
# Source dev_env.sh in ~/.bashrc (Linux only)
|
||||||
|
if not is_windows:
|
||||||
|
bashrc_path = pathlib.Path(os.path.expanduser("~/.bashrc"))
|
||||||
|
devenv_script_path = install_dir / "dev_env.sh"
|
||||||
|
source_line = f'source "{devenv_script_path}"'
|
||||||
|
|
||||||
|
# Check if already present
|
||||||
|
already_present = False
|
||||||
|
if bashrc_path.exists():
|
||||||
|
bashrc_content = bashrc_path.read_text()
|
||||||
|
if source_line in bashrc_content:
|
||||||
|
already_present = True
|
||||||
|
|
||||||
|
if not already_present:
|
||||||
|
devenver.lprint(f"Adding dev_env.sh source line to {bashrc_path}")
|
||||||
|
with open(bashrc_path, "a") as f:
|
||||||
|
f.write(f"\n{source_line}\n")
|
||||||
else:
|
else:
|
||||||
dev_env_script_path = (install_dir / "dev_env_update.sh")
|
devenver.lprint(f"dev_env.sh source line already exists in {bashrc_path}")
|
||||||
user_env_script_path = (install_dir / "user_env_update.sh")
|
|
||||||
dev_env_script_path.write_text(f"{sys.executable} {install_script_path} --with-dev-apps linux\n")
|
|
||||||
user_env_script_path.write_text(f"{sys.executable} {install_script_path} --with-user-apps linux\n")
|
|
||||||
subprocess.run(args=["chmod", "+x", dev_env_script_path])
|
|
||||||
subprocess.run(args=["chmod", "+x", user_env_script_path])
|
|
||||||
|
|
||||||
# Use LLVM script to fix up bloated installation
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# See: https://github.com/zufuliu/llvm-utils/blob/main/llvm/llvm-link.bat
|
|
||||||
internal_dir = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) / "Internal"
|
|
||||||
if is_windows:
|
|
||||||
devenver.print_header("Use LLVM utils script to slim installation size")
|
|
||||||
llvm_install_dir_set = set()
|
|
||||||
for entry in installed_dev_apps["LLVM"]:
|
|
||||||
llvm_install_dir_set.add(entry['install_dir'])
|
|
||||||
|
|
||||||
llvm_script_src_path = internal_dir / "win_llvm-link-ad01970-2022-08-29.bat"
|
|
||||||
for llvm_install_dir in llvm_install_dir_set:
|
|
||||||
llvm_script_dest_path = llvm_install_dir / "llvm-link.bat"
|
|
||||||
shutil.copy(llvm_script_src_path, llvm_script_dest_path)
|
|
||||||
subprocess.run(llvm_script_dest_path, cwd=llvm_install_dir)
|
|
||||||
os.remove(llvm_script_dest_path)
|
|
||||||
|
|
||||||
# Install fzf scripts
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
if not is_windows:
|
|
||||||
shutil.copy(internal_dir / "unix_fzf-completion.bash", install_dir)
|
|
||||||
shutil.copy(internal_dir / "unix_fzf-key-bindings.bash", install_dir)
|
|
||||||
|
|
||||||
# Install left-overs
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
devenver.print_header("Install configuration files")
|
|
||||||
|
|
||||||
# ClangFormat
|
|
||||||
clang_format_src_path = internal_dir / "os_clang_format_style_file"
|
|
||||||
clang_format_dest_path = install_dir / "_clang-format"
|
|
||||||
devenver.lprint(f"Copying clang-format file from {clang_format_src_path} to {clang_format_dest_path}")
|
|
||||||
shutil.copy(clang_format_src_path, clang_format_dest_path)
|
|
||||||
|
|
||||||
# Copy init.vim to NVIM directory
|
|
||||||
nvim_init_dir = ""
|
|
||||||
|
|
||||||
if is_windows:
|
|
||||||
nvim_init_dir = pathlib.Path(os.path.expanduser("~")) / "AppData" / "Local" / "nvim"
|
|
||||||
else:
|
|
||||||
nvim_init_dir = pathlib.Path(os.path.expanduser("~")) / ".config" / "nvim"
|
|
||||||
|
|
||||||
nvim_config_dest_path = nvim_init_dir / "init.vim"
|
|
||||||
nvim_config_src_path = internal_dir / "os_nvim_init.vim"
|
|
||||||
|
|
||||||
devenver.lprint(f"Installing NVIM config to {nvim_config_dest_path}")
|
|
||||||
nvim_init_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
shutil.copy(nvim_config_src_path, nvim_config_dest_path)
|
|
||||||
|
|
||||||
# Download vim.plug to NVIM init directory
|
|
||||||
nvim_plug_vim_dir = nvim_init_dir / "autoload"
|
|
||||||
nvim_plug_vim_path = nvim_plug_vim_dir / "plug.vim"
|
|
||||||
nvim_plug_vim_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
if not os.path.exists(nvim_plug_vim_path):
|
|
||||||
devenver.lprint(f"Installing NVIM plugin manager to {nvim_plug_vim_path}")
|
|
||||||
urllib.request.urlretrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim",
|
|
||||||
nvim_plug_vim_path)
|
|
||||||
|
|
||||||
# Install user apps
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
if args.with_user_apps:
|
|
||||||
app_list = app_manifest_user.get_manifest(is_windows=is_windows)
|
|
||||||
installed_user_apps = devenver.run(user_app_list=app_list,
|
|
||||||
download_dir=download_dir,
|
|
||||||
install_dir=install_dir,
|
|
||||||
devenv_script_name="user_env",
|
|
||||||
is_windows=is_windows)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user