diff --git a/lua/custom/plugins/additional_keymaps.lua b/lua/custom/plugins/additional_keymaps.lua new file mode 100644 index 00000000..0276df2b --- /dev/null +++ b/lua/custom/plugins/additional_keymaps.lua @@ -0,0 +1,36 @@ +-- mgua: here are my additional keymaps + +-- .o. / .wo. ecc are the "scopes" +-- .o. is the general settings +-- .wo. are the windows scoped options +-- .bo. are the buffer scope +-- see https://vonheikemen.github.io/devlog/tools/configuring-neovim-using-lua/ +vim.cmd [[ + set cc=90 " column where to put vertical bar + set shiftwidth=4 + set tabstop=4 + set scrolloff=4 " never allow curson closer than 4 lines from upper/bottom borders + set encoding=UTF-8 " default encoding + set nowrap! + set list + "next two lines are the same: in unicode and in equivalente representations + "set listchars=eol:⏎,tab:▸·,trail:·,space:·,nbsp:⎵ " center dot: alt-250 + "set listchars=eol:\\u23ce,tab:\\u25b8\\u2500,trail:\\u00b7,space:\\u00b7,nbsp:\\u23b5 + "let g:python3_host_prog='~/venv_nvim/bin/python' " linux + let g:python3_host_prog='c:\Users\mgua0\venv_nvim\Scripts\python.exe' " windows + +]] +vim.opt.relativenumber = true +vim.opt.cursorline = true +vim.opt.listchars = { eol = '↲', tab = '▸-', trail = '·', space = '·', nbsp = '_' } +--vim.opt.listchars = {eol = '\\u23ce', tab = '\\u25b8\\u2500', trail = '\\u00b7', space = '\\u00b7', nbsp = '\\u23b5'} + +-- i want to make tt to toggle nvtree +vim.keymap.set("n", "tt", ":NvimTreeToggle") +-- vim.keymap.set("n", "r", ":%s///g") +vim.keymap.set("n", "", "gT") -- go to previous tab +vim.keymap.set("n", "", "gt") -- go to next tab +vim.keymap.set("n", "", ":bprev") -- change current tab to previous buffer +vim.keymap.set("n", "", ":bnext") -- change current tab to next buffer + +return {} diff --git a/lua/custom/plugins/alpha._lua b/lua/custom/plugins/alpha._lua new file mode 100644 index 00000000..544294eb --- /dev/null +++ b/lua/custom/plugins/alpha._lua @@ -0,0 +1,12 @@ +-- modern alternative to startify +-- this loader does not work + +return { + 'goolord/alpha-nvim', + requires = { 'nvim-tree/nvim-web-devicons' }, + config = function () + require'alpha'.setup(require'alpha.themes.startify'.config) + end, +} + +return {} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100644 index 00000000..701894c4 --- /dev/null +++ b/lua/custom/plugins/nvim-tree.lua @@ -0,0 +1,14 @@ +-- this is from https://github.com/nvim-tree/nvim-tree.lua + +return { + "nvim-tree/nvim-tree.lua", + version = "*", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("nvim-tree").setup {} + --require("nvim-web-devicons").setup {} + end, +} + diff --git a/lua/custom/plugins/nvim-web-devicons.lua b/lua/custom/plugins/nvim-web-devicons.lua new file mode 100644 index 00000000..abe11585 --- /dev/null +++ b/lua/custom/plugins/nvim-web-devicons.lua @@ -0,0 +1,52 @@ +-- this is from https://github.com/nvim-tree/nvim-web-devicons +-- required for nvim-tree + +return { + "nvim-tree/nvim-web-devicons", + version = "*", + config = function() + require("nvim-web-devicons").setup { + -- your personnal icons can go here (to override) + -- you can specify color or cterm_color instead of specifying both of them + -- DevIcon will be appended to `name` + override = { + zsh = { + icon = "", + color = "#428850", + cterm_color = "65", + name = "Zsh" + } + }; + -- globally enable different highlight colors per icon (default to true) + -- if set to false all icons will have the default icon's color + color_icons = true; + -- globally enable default icons (default to false) + -- will get overriden by `get_icons` option + default = true; + -- globally enable "strict" selection of icons - icon will be looked up in + -- different tables, first by filename, and if not found by extension; this + -- prevents cases when file doesn't have any extension but still gets some icon + -- because its name happened to match some extension (default to false) + strict = true; + -- same as `override` but specifically for overrides by filename + -- takes effect when `strict` is true + override_by_filename = { + [".gitignore"] = { + icon = "", + color = "#f1502f", + name = "Gitignore" + } + }; + -- same as `override` but specifically for overrides by extension + -- takes effect when `strict` is true + override_by_extension = { + ["log"] = { + icon = "", + color = "#81e043", + name = "Log" + } + }; + } + end, + } + diff --git a/lua/custom/plugins/startify.lua b/lua/custom/plugins/startify.lua new file mode 100644 index 00000000..b232385a --- /dev/null +++ b/lua/custom/plugins/startify.lua @@ -0,0 +1,4 @@ +-- the classical startify +return { + 'mhinz/vim-startify' + } \ No newline at end of file diff --git a/lua/custom/plugins/vim-oscyank.txt b/lua/custom/plugins/vim-oscyank.txt new file mode 100644 index 00000000..06152ac7 --- /dev/null +++ b/lua/custom/plugins/vim-oscyank.txt @@ -0,0 +1,38 @@ +-- this is for support of clipboard across remote ssh +-- I need to bring it to lua +-- +-- This does not have prerequirements on windows. It works if you use windows terminal +-- and works across ssh sessions. does not currently (apr 2023) work with mremote nor putty +-- +-- + +-- Plug 'ojroques/vim-oscyank', {'branch': 'main'} " enables Clipboard across SSH mgua 8 apr 2023 +-- " OSC52 compatibility is required in ssh terminal and in tmux if used +-- " see https://github.com/ojroques/vim-oscyank +-- + +" the next settings are for OSCYank (see :h oscyank-config) ---------------- +" to copy the line cc +" to copy all: ggVGc (ggVG selects everything in visual mode) +" leader-c yanks visually selected +" +lua << EOFOSCYANK + -- keymapping defined in lua mode + vim.keymap.set('n', 'c', 'OSCYankOperator') + vim.keymap.set('n', 'cc', 'c_', {remap = true}) + vim.keymap.set('v', 'c', 'OSCYankVisual') +EOFOSCYANK +let g:oscyank_max_length = 0 " maximum length of a selection +let g:oscyank_silent = 0 " disable message on successful copy +let g:oscyank_trim = 1 " trim surrounding whitespaces before copy +let g:oscyank_osc52 = "\x1b]52;c;%s\x07" " the OSC52 format string to use +"The following commands are also available: +" :OSCYank(text): copy text text +" :OSCYankRegister(register): copy text from register register +"For instance, to automatically copy text that was yanked into register +: +autocmd TextYankPost * + \ if v:event.operator is 'y' && v:event.regname is '+' | + \ execute 'OSCYankRegister +' | + \ endif +"OSCYank cfg end ----------------------------------------------------------- +"