commit f750e44e1a0c7217753e8b2f7ec297256d6ac752 Author: Mészáros Zoltán Date: Tue Jun 16 12:27:51 2026 +0200 First release diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..a2c480f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*~ +/plugin +/doc/neovim/.obsidian + diff --git a/doc/neovim/0 - Prerequisities.md b/doc/neovim/0 - Prerequisities.md new file mode 100755 index 0000000..32ba9b9 --- /dev/null +++ b/doc/neovim/0 - Prerequisities.md @@ -0,0 +1,9 @@ + +| Environment variable | Path | +| :- | :- | +|XDG_CONFIG_HOME| z:\\home\\.config| +|XDG_DATA_HOME|z:\\home\\.data| + +### Folder structure + +~/.config/nvim diff --git a/doc/neovim/1 - Basic install.md b/doc/neovim/1 - Basic install.md new file mode 100755 index 0000000..e69de29 diff --git a/doc/neovim/2 - Font, icons, color-schema and status-line.md b/doc/neovim/2 - Font, icons, color-schema and status-line.md new file mode 100755 index 0000000..e47b528 --- /dev/null +++ b/doc/neovim/2 - Font, icons, color-schema and status-line.md @@ -0,0 +1,105 @@ +## 2.1 - Font + +The font we use in neovim is one from the [nerd]() font collection. Those fonts contain special characters used as an icon in NeoVim. "SauceCodePro NF" is a derivation of the "SourceCodePro" font. + +`lua/roka/core/options.lua` +```lua +vim.opt.guifont = { "SauceCodePro NF:h11:#e-subpixelantialias:#h-none" } +``` + +## 2.2 - Icons + +The various icons can be used by many plugins, example _nvim-tree_ or _lualine_. + +`lua/roka/core/plugins.lua` +```lua +return require('packer').startup(function() + -- other plugins... + + use "kyazdani42/nvim-web-devicons" + + -- other plugins... +end) +``` + +## 2.3 - Color-scheme + +`lua/roka/core/plugins.lua` +```lua +return require('packer').startup(function() + -- other plugins... + + use { "bluz71/vim-nightfly-colors", as = "nighfly" } + use { "bluz71/vim-moonfly-colors", as = "moonfly" } + + -- other plugins... +end) +``` +`lua/roka/plug/color.lua` + +`init.lua` +```lua + -- other requires + + require( "roka.plug.color") + + -- other requires +``` + +## 2.4 - LuaLine + +`lua/roka/core/plugins.lua` +```lua +return require('packer').startup(function() + -- other plugins... + + use "nvim-lualine/lualine.nvim" + + -- other plugins... +end) +``` + +`lua/roka/plug/lualine.lua` +```lua +local status, lualine = pcall( require, "lualine") +if not status then + return +end + +local lualine_nightfly = require("lualine.themes.nightfly") + +local new_colors = { + blue = "#65D1FF", + green = "#3EFFDC", + violet = "#FF61EF", + yellow = "#FFDA7B", + black = "#000000", +} + +lualine_nightfly.normal.a.bg = new_colors.blue +lualine_nightfly.insert.a.bg = new_colors.green +lualine_nightfly.visual.a.bg = new_colors.violet + +lualine_nightfly.command = { + a = { + gui = "bold", + bg = new_colors.yellow, + fg = new_colors.black, + }, +} + +lualine.setup({ + options = { + theme = lualine_nightfly + } +}) +``` + +`init.lua` +```lua + -- other requires + + require( "roka.plug.lualine") + + -- other requires +``` diff --git a/doc/neovim/3 - Telescope.md b/doc/neovim/3 - Telescope.md new file mode 100755 index 0000000..8564646 --- /dev/null +++ b/doc/neovim/3 - Telescope.md @@ -0,0 +1,136 @@ +`lua/roka/core/plugins.lua` +```lua +return require('packer').startup(function() + -- other plugins... + + use "nvim-telescope/telescope.nvim" + + -- other plugins... +end) +``` +`lua/roka/plug/telescope.lua` +```lua +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +telescope.load_extension('media_files') + +local actions = require "telescope.actions" + +telescope.setup { + defaults = { + + prompt_prefix = " ", + selection_caret = " ", + path_display = { "smart" }, + + -- The minimal init not showing preview by default is likely due to the default + -- preview_cutoff value of 120 columns. It looks like your terminal is smaller than 120 columns. + -- Set cutoff to zero to show the preview anyway + layout_config = { + horizontal = { + preview_cutoff = 0, + }, + }, + + mappings = { + i = { + ["" ] = actions.cycle_history_next, + ["" ] = actions.cycle_history_prev, + + ["" ] = actions.move_selection_next, + ["" ] = actions.move_selection_previous, + + ["" ] = actions.close, + + [""] = actions.move_selection_next, + ["" ] = actions.move_selection_previous, + + ["" ] = actions.select_default, + ["" ] = actions.select_horizontal, + ["" ] = actions.select_vertical, + ["" ] = actions.select_tab, + + ["" ] = actions.preview_scrolling_up, + ["" ] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.complete_tag, + [""] = actions.which_key, -- keys from pressing + }, + + n = { + ["" ] = actions.close, + ["" ] = actions.select_default, + ["" ] = actions.select_horizontal, + ["" ] = actions.select_vertical, + ["" ] = actions.select_tab, + + ["" ] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + ["" ] = actions.send_to_qflist + actions.open_qflist, + ["" ] = actions.send_selected_to_qflist + actions.open_qflist, + + ["j"] = actions.move_selection_next, + ["k"] = actions.move_selection_previous, + ["H"] = actions.move_to_top, + ["M"] = actions.move_to_middle, + ["L"] = actions.move_to_bottom, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + ["gg"] = actions.move_to_top, + ["G"] = actions.move_to_bottom, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + ["?"] = actions.which_key, + }, + }, + }, + -- pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + -- }, + extensions = { + media_files = { + -- filetypes whitelist + -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} + filetypes = {"png", "webp", "jpg", "jpeg"}, + find_cmd = "rg" -- find command (defaults to `fd`) + } + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + }, +} +``` + +`init.lua` +```lua + -- other requires + + require( "roka.plug.telescope") + + -- other requires +``` + diff --git a/init.lua b/init.lua new file mode 100755 index 0000000..ce2b511 --- /dev/null +++ b/init.lua @@ -0,0 +1,7 @@ + + +require( "roka.core.options") +require( "roka.core.keymaps") +require( "roka.core.plugins") + +require( "roka.plug.color" ) \ No newline at end of file diff --git a/lua/roka/core/keymaps.lua b/lua/roka/core/keymaps.lua new file mode 100755 index 0000000..317972e --- /dev/null +++ b/lua/roka/core/keymaps.lua @@ -0,0 +1,122 @@ +vim.g.mapleader = " " + +local keymap = vim.keymap + +-- Modes +-- +-- "n" = normal mode +-- "i" = insert mode +-- "v" = visual mode +-- "x" = visual block mode +-- "t" = term mode +-- "c" = command mode +-- + +-- ---------------------------------------------------------------------------- +-- Normal +-- ---------------------------------------------------------------------------- +-- Window splitting +keymap.set( "n", "sv", "v" ) -- split widow vertically +keymap.set( "n", "sh", "s" ) -- split widow horizontaly +keymap.set( "n", "se", "=" ) -- make split windows equal width +keymap.set( "n", "sx", ":close" ) -- close window +-- keymap.set( "n", "sm", ":MaximizerToggle" ) +keymap.set( "n", "sm", 'lua require("maximizer").toggle()', {silent = true, noremap = true}) +-- keymap.set('n', 'mm', 'lua require("maximizer").maximize()', {silent = true, noremap = true}) +-- keymap.set('n', 'mr', 'lua require("maximizer").restore()', {silent = true, noremap = true}) +-- + +-- Window navigation +keymap.set( "n", "", "h") +keymap.set( "n", "", "j") +keymap.set( "n", "", "k") +keymap.set( "n", "", "l") + +-- +-- Insert date +-- +keymap.set( "n", "d", ":pu=strftime('%Y-%m-%d')" ) + +-- +-- +-- +--keymap.set( "n", "f", ":toggle-fullscreen" ) +-- Resize window with arrows +-- keymap.set( "n", "", ":vertical resize -2") +-- keymap.set( "n", "", ":vertical resize +2") +-- keymap.set( "n", "", ":resize +2") +-- keymap.set( "n", "", ":resize -2") + +-- keymap.set( "n", "e", ":Lex 30 ") + +-- Buffers +keymap.set( "n", "", ":bnext" ) -- next buffer +keymap.set( "n", "", ":bprevious" ) -- prev buffer +keymap.set( "n", "", ":bd" ) -- delete buffer + +-- TABs +keymap.set( "n", "to", ":tabnew" ) -- open new tab +keymap.set( "n", "tx", ":tabclose" ) -- close current tab +keymap.set( "n", "tn", ":tabn" ) -- go to next tab +keymap.set( "n", "tp", ":tabp" ) -- go to prev tab + +-- diagnostic warning/error navigation +keymap.set( "n", "g[", vim.diagnostic.goto_prev) +keymap.set( "n", "g]", vim.diagnostic.goto_next) + +-- +keymap.set( "n", ",", "*" ) -- due to HUN keybard, the * hard to access: + + + +-- ---------------------------------------------------------------------------- +-- Insert mode +-- ---------------------------------------------------------------------------- +keymap.set("i", "jk", "") + +-- ---------------------------------------------------------------------------- +-- Visual mode +-- ---------------------------------------------------------------------------- +-- Stay in indent mode +keymap.set("v", "<", "", ">gv") + +-- Visual Block -- +keymap.set("v", "", ":m .+1==") +keymap.set("v", "", ":m .-2==") +keymap.set("v", "p", '"_dP') + +-- Move text up and down +keymap.set( "x", "J", ":move '>+1gv-gv") +keymap.set( "x", "K", ":move '<-2gv-gv") +keymap.set( "x", "", ":move '>+1gv-gv") +keymap.set( "x", "", ":move '<-2gv-gv") + + +-- Terminal -- +-- Better terminal navigation +keymap.set( "t", "", "h") +keymap.set( "t", "", "j") +keymap.set( "t", "", "k") +keymap.set( "t", "", "l") + +keymap.set("n", "nh", ":nohl") +keymap.set("n", "x", '"_x"') + +keymap.set("n", "", ":tabn") -- go to next tab +keymap.set("n", "", ":tabp") -- go to prev tab +-- plugin keymaps + +-- nvim-tree +keymap.set("n", "e", ":NvimTreeToggle") + +-- telescope +--keymap.set("n", "ff", ":Telescope find_files" ) +keymap.set("n", "ff", ":Files" ) +keymap.set("n", "fs", ":Telescope live_grep" ) +keymap.set("n", "fg", ":Rg") +keymap.set("n", "fb", ":Telescope buffers" ) +keymap.set("n", "fh", ":Telescope help_tags" ) + +keymap.set("n", "x", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))") +keymap.set("n", "", "Telescope live_grep") diff --git a/lua/roka/core/options.lua b/lua/roka/core/options.lua new file mode 100755 index 0000000..3d594bc --- /dev/null +++ b/lua/roka/core/options.lua @@ -0,0 +1,121 @@ +local opt = vim.opt + +-- [[ Font ]] +--opt.guifont = { "SauceCodePro NF:h11:r:#e-subpixelantialias:#h-none" } +--opt.guifont = { "BlexMono NFM:h11:l:i:#e-subpixelantialias:#h-none" } +opt.guifont = { "BlexMono NFM:h11:l:#e-subpixelantialias:#h-none" } + +-- [[ Context ]] +opt.number = true -- set numbered lines +opt.relativenumber = true -- show relative numbers +opt.numberwidth = 4 -- set line number column width to 4 +opt.colorcolumn = '100' -- show color for max line length + +-- [[ Whitespace ]] +opt.expandtab = true -- convert tabs to spaces +opt.shiftwidth = 4 -- size of an indent +opt.softtabstop = 4 -- number of spaces tabs count for in insert mode +opt.tabstop = 4 -- number of spaces tabs count for + +opt.autoindent = true + +-- [[ Filetypes ]] +opt.encoding = 'utf8' -- string encoding +opt.fileencoding = 'utf8' -- file encoding + +-- [[ Theme ]] +opt.syntax = 'ON' -- allow syntax highlighting +opt.termguicolors = true -- set term gui colors (most terminals support this) + +-- ------------------------------------------------------------------------------------------------ +-- line wrapping +-- ------------------------------------------------------------------------------------------------ +opt.wrap = false -- display lines as one long line + +-- ------------------------------------------------------------------------------------------------ +-- search settings +-- ------------------------------------------------------------------------------------------------ +-- [[ Search ]] +opt.ignorecase = true -- ignore case in search patterns +opt.smartcase = true -- override ignorecase if search contains capital +opt.incsearch = true -- use incremental search +opt.hlsearch = true -- highlight search matches + +-- ------------------------------------------------------------------------------------------------ +-- cursor line +-- ------------------------------------------------------------------------------------------------ +opt.cursorline = false -- highlight the current line + +-- ------------------------------------------------------------------------------------------------ +-- appearance +-- ------------------------------------------------------------------------------------------------ + +opt.background = "dark" +opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +opt.scrolloff = 4 -- is one of my fav +opt.sidescrolloff = 4 -- The minimal number of screen columns to keep +opt.cmdheight = 1 -- more space in the neovim command line for displaying messages + +vim.cmd([[ +set noshowmode +]]) + + +-- ------------------------------------------------------------------------------------------------ +-- backspace +-- ------------------------------------------------------------------------------------------------ +opt.backspace = "indent,eol,start" + +-- ------------------------------------------------------------------------------------------------ +-- split windows +-- ------------------------------------------------------------------------------------------------ +-- [[ Splits ]] +opt.splitright = true -- place new window to right of current one +opt.splitbelow = true -- place new window below the current one + +-- ------------------------------------------------------------------------------------------------ +-- AutoCompletion +-- +-- set the completeopt to have a better completion experience +-- :help completeopt +-- +-- menuone : popup even when there's only one match +-- noinsert : do not insert text until a selection is made +-- noselect : do not select, force to select one from the menu +-- shortmess : avoid showing extra messages when using completion +-- updatetime : set updatetime for CursorHold +-- ------------------------------------------------------------------------------------------------ +opt.completeopt = {'menuone', 'noselect', 'noinsert'} +opt.shortmess = opt.shortmess + { c = true} +opt.updatetime = 100 +--vim.api.nvim_set_option( 'updatetime', 300) + +-- fixed column for diagnostic to appear +-- show autodiagnostic popup on cursor hover_range +-- goto previous/next diagnostic warning/error +-- show inlay_hints more frequently +vim.cmd([[ +set signcolumn=yes +autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) +]]) + +-- ------------------------------------------------------------------------------------------------ +-- clipboard +-- ------------------------------------------------------------------------------------------------ +opt.clipboard:append("unnamedplus") -- allows neovim to access the system clipboard +opt.iskeyword:append("-") + +--vim.g.neovide_cursor_vfx_mode = "" +--vim.g.neovide_cursor_animation_length = 0 +--vim.g.neovide_transparency = 1.0 +--vim.g.neovide_remember_window_size = true +---- vim.g.neovide_profiler =false +--vim.g.neovide_scroll_animation_length = 0.0 + + +-- +-- which.key options - 2026-05-28 +-- +vim.o.timeout = true +vim.o.timeoutlen = 300 +vim.o.mouse = '' diff --git a/lua/roka/core/plugins.lua b/lua/roka/core/plugins.lua new file mode 100755 index 0000000..a9ec9a9 --- /dev/null +++ b/lua/roka/core/plugins.lua @@ -0,0 +1,231 @@ +local fn = vim.fn + +-- ---------------------------------------------------------------------------- +-- Automatically install packer +-- ---------------------------------------------------------------------------- +local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" + +if fn.empty(fn.glob(install_path)) > 0 then + PACKER_BOOTSTRAP = fn.system { + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim", + install_path, + } + + print "Installing packer. Close and reopen Neovim..." + + vim.cmd [[ + packadd packer.nvim + ]] +end + +-- ---------------------------------------------------------------------------- +-- Autocommand that reloads neovim whenever you save the plugins.lua file +-- ---------------------------------------------------------------------------- +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.lua source | PackerSync + augroup end +]] + +-- ---------------------------------------------------------------------------- +-- Use a protected call so we don't error out on first use +-- ---------------------------------------------------------------------------- +local status, packer = pcall(require, "packer") +if not status then + return +end + +-- ---------------------------------------------------------------------------- +-- Have packer use a popup window +-- ---------------------------------------------------------------------------- +packer.init { + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, +} + +-- ---------------------------------------------------------------------------- +-- Install plugins +-- ---------------------------------------------------------------------------- +return packer.startup(function(use) + + -- ------------------------------------------------------ + -- Have packer manage itself + -- ------------------------------------------------------ + use "wbthomason/packer.nvim" + + + use "lewis6991/impatient.nvim" + + -- ---------------------------------------------------- + -- web devicons used by e.g.: nvim-tree, lualine, ... + -- ---------------------------------------------------- + use "kyazdani42/nvim-web-devicons" + + -- ---------------------------------------------------- + -- colorschemas + -- ---------------------------------------------------- + use { "bluz71/vim-nightfly-colors", as = "nighfly" } + use { "bluz71/vim-moonfly-colors", as = "moonfly" } + + -- ---------------------------------------------------- + -- lualine (status line) + -- ---------------------------------------------------- + use { + "nvim-lualine/lualine.nvim", + + config = function() + require( "roka.plug.lualine") + end + } + + -- -------------------------------------------------------------- + -- telescope + -- -------------------------------------------------------------- + use { + "nvim-telescope/telescope.nvim", + -- branch = "0.1.x", + branch = "0.1.x", + + requires = { + { "nvim-lua/plenary.nvim"}, + { "nvim-telescope/telescope-media-files.nvim"}, + { "nvim-telescope/telescope-fzy-native.nvim"}, + }, + + config = function() + require( "roka.plug.telescope") + end + } + + -- ---------------------------------------------------- + -- nvim-tree + -- ---------------------------------------------------- + use { + "nvim-tree/nvim-tree.lua", + + config = function() + require( "roka.plug.nvim-tree") + end + } + + -- -------------------------------------------------------------- + -- autocompletion + -- -------------------------------------------------------------- + use { + "hrsh7th/nvim-cmp", + + requires = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-calc", + "saadparwaiz1/cmp_luasnip", + }, + + config = function() + require( "roka.plug.nvim-cmp") + end + } + + -- -------------------------------------------------------------- + -- autocompletion/snippets + -- -------------------------------------------------------------- + use { + "L3MON4D3/LuaSnip", -- Required + "rafamadriz/friendly-snippets", -- Optional + } + + -- -------------------------------------------------------------- + -- bufferline - mz + -- -------------------------------------------------------------- + use { + "akinsho/bufferline.nvim", + tag = "*", + requires = "nvim-tree/nvim-web-devicons", + + +-- vim.opt.termguicolors = true + config = function() +-- require("bufferline").setup{} + require("roka.plug.bufferline") + end + + } + + -- -------------------------------------------------------------- + -- fzf - mz + -- -------------------------------------------------------------- + use { + "junegunn/fzf.vim", + requires = { 'junegunn/fzf', run = ':call fzf#install()' } + } + + -- -------------------------------------------------------------- + -- nvim-treesitter - mz + -- -------------------------------------------------------------- + use { + 'nvim-treesitter/nvim-treesitter', + branch = "master", + run = ':TSUpdate', -- This automatically updates parsers on install/update + } + + -- -------------------------------------------------------------- + -- render-markdown - mz + -- -------------------------------------------------------------- + use { + "MeanderingProgrammer/render-markdown.nvim", + after = { 'nvim-treesitter' }, + -- requires = { 'nvim-mini/mini.nvim', opt = true }, -- if you use the mini.nvim suite + requires = { 'nvim-mini/mini.icons', opt = true }, -- if you use standalone mini plugins + -- requires = { 'nvim-tree/nvim-web-devicons', opt = true }, -- if you prefer nvim-web-devicons + config = function() + require('render-markdown').setup({}) + end + } + + -- ------------------------------------------------------------- + -- which-key + -- ------------------------------------------------------------- + use "folke/which-key.nvim" + + -- ------------------------------------------------------------- + -- toggle-fullscreen - 2026-05-31 + -- ------------------------------------------------------------- + -- use { + -- "propet/toggle-fullscreen.nvim", + -- config = function() + -- require('toggle-fullscreen').setup({}) + -- end + -- } + -- + -- ------------------------------------------------------------- + -- maximizer - 2026-05-31 + -- ------------------------------------------------------------- + use { + "0x00-ketsu/maximizer.nvim", + config = function() + require("maximizer").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + end + } + + -- ------------------------------------------------------------------- + -- Automatically set up your configuration after cloning packer.nvim. + -- Put this at the end after all plugins. + -- ------------------------------------------------------------------- + if PACKER_BOOTSTRAP then + require("packer").sync() + end +end) diff --git a/lua/roka/plug/bufferline.lua b/lua/roka/plug/bufferline.lua new file mode 100755 index 0000000..49d5f1b --- /dev/null +++ b/lua/roka/plug/bufferline.lua @@ -0,0 +1,3 @@ +vim.opt.termguicolors = true +require("bufferline").setup{} + diff --git a/lua/roka/plug/color.lua b/lua/roka/plug/color.lua new file mode 100755 index 0000000..d3650b2 --- /dev/null +++ b/lua/roka/plug/color.lua @@ -0,0 +1,26 @@ +local colorscheme = "moonfly" + +local custom_highlight = + vim.api.nvim_create_augroup( "CustomHighlight", {}) + vim.api.nvim_create_autocmd( "ColorScheme", { + pattern = "nightfly", + callback = function() + vim.api.nvim_set_hl( 0, "String", { fg = "#00A000", italic = false }) + vim.api.nvim_set_hl( 0, "Comment", { fg = "#808080", italic = false }) + vim.api.nvim_set_hl( 0, "Function", { fg = "#82aaff", italic = false }) + vim.api.nvim_set_hl( 0, "CursorLineNr", { fg = "#82aaff", italic = false }) + vim.api.nvim_set_hl( 0, "Delimiter", { fg = "#ff0000", italic = false }) + end, + + group = custom_highlight, + }) + +local status, _ = pcall( vim.cmd, "colorscheme " .. colorscheme) + +if not status then + vim.notify( "Colorscheme " .. colorscheme .. " is not found!") + return +end + +vim.cmd [[ set cursorline]] +vim.cmd [[ highlight clear CursorLine]] diff --git a/lua/roka/plug/fzflua.lua b/lua/roka/plug/fzflua.lua new file mode 100755 index 0000000..642bb1e --- /dev/null +++ b/lua/roka/plug/fzflua.lua @@ -0,0 +1,101 @@ +return { + "ibhagwan/fzf-lua", + -- optional for icon support + -- dependencies = { "nvim-tree/nvim-web-devicons" }, + -- or if using mini.icons/mini.nvim + dependencies = { "echasnovski/mini.icons" }, + opts = {}, + keys={ + { + "ff", + function() require('fzf-lua').files() end, + desc="Find Files in project directory" + }, + { + "fc", + function() require('fzf-lua').files({cwd='~/.config'}) end, + desc="Find Files in config directory" + } + } + -- { + -- "fg", + -- function() require('fzf-lua').live_grep() end, + -- desc="Find by grepping in project directory" + -- }, + -- { + -- "fc", + -- function() require('fzf-lua').files({cwd=vim.fn.stdpath("config")}) end, + -- desc="Find in neovim configuration" + -- }, + -- { + -- "fh", + -- function() + -- require("fzf-lua").helptags() + -- end, + -- desc = "[F]ind [H]elp", + -- }, + -- { + -- "fk", + -- function() + -- require("fzf-lua").keymaps() + -- end, + -- desc = "[F]ind [K]eymaps", + -- }, + -- { + -- "fb", + -- function() + -- require("fzf-lua").builtin() + -- end, + -- desc = "[F]ind [B]uiltin FZF", + -- }, + -- { + -- "fw", + -- function() + -- require("fzf-lua").grep_cword() + -- end, + -- desc = "[F]ind current [W]ord", + -- }, + -- { + -- "fW", + -- function() + -- require("fzf-lua").grep_cWORD() + -- end, + -- desc = "[F]ind current [W]ORD", + -- }, + -- { + -- "fd", + -- function() + -- require("fzf-lua").diagnostics_document() + -- end, + -- desc = "[F]ind [D]iagnostics", + -- }, + -- { + -- "fr", + -- function() + -- require("fzf-lua").resume() + -- end, + -- desc = "[F]ind [R]esume", + -- }, + -- { + -- "fo", + -- function() + -- require("fzf-lua").oldfiles() + -- end, + -- desc = "[F]ind [O]ld Files", + -- }, + -- { + -- "", + -- function() + -- require("fzf-lua").buffers() + -- end, + -- desc = "[,] Find existing buffers", + -- }, + -- { + -- "/", + -- function() + -- require("fzf-lua").lgrep_curbuf() + -- end, + -- desc = "[/] Live grep the current buffer", + -- }, + -- } +} diff --git a/lua/roka/plug/lualine.lua b/lua/roka/plug/lualine.lua new file mode 100755 index 0000000..c2fca1b --- /dev/null +++ b/lua/roka/plug/lualine.lua @@ -0,0 +1,33 @@ +local status, lualine = pcall( require, "lualine") +if not status then + return +end + +local lualine_nightfly = require("lualine.themes.nightfly") + +local new_colors = { + blue = "#65D1FF", + green = "#3EFFDC", + violet = "#FF61EF", + yellow = "#FFDA7B", + black = "#000000", +} + +lualine_nightfly.normal.a.bg = new_colors.blue +lualine_nightfly.insert.a.bg = new_colors.green +lualine_nightfly.visual.a.bg = new_colors.violet + +lualine_nightfly.command = { + a = { + gui = "bold", + bg = new_colors.yellow, + fg = new_colors.black, + }, +} + +lualine.setup({ + options = { + theme = lualine_nightfly + } +}) + diff --git a/lua/roka/plug/nvim-cmp.lua b/lua/roka/plug/nvim-cmp.lua new file mode 100755 index 0000000..f417c97 --- /dev/null +++ b/lua/roka/plug/nvim-cmp.lua @@ -0,0 +1,165 @@ +local cmp_status_ok, cmp = pcall(require, "cmp") +if not cmp_status_ok then + return +end + +local snip_status_ok, luasnip = pcall(require, "luasnip") +if not snip_status_ok then + return +end + +require("luasnip/loaders/from_vscode").lazy_load() + +local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" +end + +--   פּ ﯟ   some other good icons +local kind_icons = { + Text = "", + Method = "m", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", +} +-- find more here: https://www.nerdfonts.com/cheat-sheet + +cmp.setup { + preselect = cmp.PreselectMode.None, + + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [""] = cmp.mapping { + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }, + + -- Accept currently selected item. If none selected, `select` first item. + -- Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm { select = true }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + + elseif luasnip.expandable() then + luasnip.expand() + + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + + elseif check_backspace() then + fallback() + + else + fallback() + end + end, { + "i", + "s", + }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + }, + + -- ------------------------------------------------------------------------ + -- formatting + -- ------------------------------------------------------------------------ + formatting = { + fields = { "kind", "abbr", "menu" }, + + format = function(entry, vim_item) + + -- Kind icons + vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) + + -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + vim_item.menu = ({ + nvim_lsp = "[LSP]", + nvim_lua = "[Lua]", + luasnip = "[Snippet]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end, + }, + + -- ----------------------------------------------------------------------------- + -- sources + -- ----------------------------------------------------------------------------- + -- 'buffer' - current buffer + -- 'path' - file paths + -- 'nvim_lua' - complete neovim's Lua runtime such vim.lsp.* + -- 'nvim_lsp' - from language server + -- 'nvim_lsp_signature_help' - display function signatures with current + -- parameter emphasized + -- 'vsnip' - nvim-cmp for vim-vsnip + -- ------------------------------------------------------------------------ + sources = { + { name = "path" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "nvim_lsp" }, +-- { name = "nvim_lsp_signature_help" }, + { name = "luasnip" }, + }, + + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + + window = { + documentation = cmp.config.window.bordered(), + }, + + experimental = { + ghost_text = true, + native_menu = false, + }, +} + diff --git a/lua/roka/plug/nvim-tree.lua b/lua/roka/plug/nvim-tree.lua new file mode 100755 index 0000000..b365902 --- /dev/null +++ b/lua/roka/plug/nvim-tree.lua @@ -0,0 +1,34 @@ +local setup, nvimtree = pcall( require, "nvim-tree") +if not setup then + return +end + +-- recommended settings from nvim-tree documentation +vim.g.loaded = 1 +vim.g.loaded_netrwPlugin = 1 + +vim.cmd( [[ highlight NvimTreeIndentMarker guifg = #3FC5FF ]]) + +nvimtree.setup({ + renderer = { + icons = { + glyphs = { + folder = { + arrow_closed = "→", + arrow_open = "↓", + }, + }, + }, + }, + + -- disable window_picker for explorer + -- to work well with window splits + actions = { + open_file = { + window_picker = { + enable = false, + }, + }, + }, +}) + diff --git a/lua/roka/plug/telescope.lua b/lua/roka/plug/telescope.lua new file mode 100755 index 0000000..650f037 --- /dev/null +++ b/lua/roka/plug/telescope.lua @@ -0,0 +1,113 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +telescope.load_extension('media_files') + +local actions = require "telescope.actions" + +telescope.setup { + defaults = { + + prompt_prefix = " ", + selection_caret = " ", + path_display = { "smart" }, + + -- The minimal init not showing preview by default is likely due to the default + -- preview_cutoff value of 120 columns. It looks like your terminal is smaller than 120 columns. + -- Set cutoff to zero to show the preview anyway + layout_config = { + horizontal = { + preview_cutoff = 0, + }, + }, + + mappings = { + i = { + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.close, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.complete_tag, + [""] = actions.which_key, -- keys from pressing + }, + + n = { + [""] = actions.close, + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + + ["j"] = actions.move_selection_next, + ["k"] = actions.move_selection_previous, + ["H"] = actions.move_to_top, + ["M"] = actions.move_to_middle, + ["L"] = actions.move_to_bottom, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + ["gg"] = actions.move_to_top, + ["G"] = actions.move_to_bottom, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + ["?"] = actions.which_key, + }, + }, + }, + -- pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + -- }, + extensions = { + media_files = { + -- filetypes whitelist + -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} + filetypes = {"png", "webp", "jpg", "jpeg"}, + find_cmd = "rg" -- find command (defaults to `fd`) + } + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + }, +} diff --git a/lua/roka/plug/treesitter.lua b/lua/roka/plug/treesitter.lua new file mode 100755 index 0000000..eb9f86f --- /dev/null +++ b/lua/roka/plug/treesitter.lua @@ -0,0 +1,25 @@ +require('nvim-treesitter.configs').setup { + -- A list of parser names, or "all" + ensure_installed = { + "lua", "vim", "vimdoc", "query", + "javascript", "typescript", "tsx", + "python", "rust", "go", "c", "cpp", + "pascal", "latex", "yaml", + -- add more as needed + }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + auto_install = true, + + highlight = { + enable = true, -- false will disable the whole extension + additional_vim_regex_highlighting = false, + }, + + indent = { + enable = true, + }, +} diff --git a/lua/roka/plug/which-key.lua b/lua/roka/plug/which-key.lua new file mode 100755 index 0000000..fe058e2 --- /dev/null +++ b/lua/roka/plug/which-key.lua @@ -0,0 +1,44 @@ +require("which-key").setup { + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + spelling = { + enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + suggestions = 20, -- how many suggestions should be shown in the list? + }, + presets = { + operators = true, -- adds help for operators like d, y, ... + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g + }, + }, + operators = { gc = "Comments" }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + popup_mappings = { + scroll_down = "", -- binding to scroll down inside the popup + scroll_up = "", -- binding to scroll up inside the popup + }, + window = { + border = "none", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. + padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent + zindex = 1000, -- positive value to position WhichKey above other floating windows. + }, +} + +-- which-key +-- vim.o.timeout = true +-- vim.o.timeoutlen = 300 +-- vim.o.mouse = '' diff --git a/readme.md b/readme.md new file mode 100755 index 0000000..fe65074 --- /dev/null +++ b/readme.md @@ -0,0 +1,6 @@ +# Important !!! +after switching to another branch, the following folders must be deleted + +- delete `%XDG_CACHE_HOME%\nvim` folder +- delete `%XDG_CONFIG_HOME%\nvim\plugin` folder +- delete `%XDG_DATA_HOME%\nvim-data` folder