diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..006beb7 --- /dev/null +++ b/init.lua @@ -0,0 +1,2 @@ +require("trixy") + diff --git a/init.vim b/init.vim deleted file mode 100644 index e8c439d..0000000 --- a/init.vim +++ /dev/null @@ -1,148 +0,0 @@ - -" ███ ▄████████ ▄█ ▀████ ▐████▀ ▄██ ▄ -" ▀█████████▄ ███ ███ ███ ███▌ ████▀ ███ ██▄ -" ▀███▀▀██ ███ ███ ███▌ ███ ▐███ ███▄▄▄███ -" ███ ▀ ▄███▄▄▄▄██▀ ███▌ ▀███▄███▀ ▀▀▀▀▀▀███ -" ███ ▀▀███▀▀▀▀▀ ███▌ ████▀██▄ ▄██ ███ -" ███ ▀███████████ ███ ▐███ ▀███ ███ ███ -" ███ ███ ███ ███ ▄███ ███▄ ███ ███ -" ▄████▀ ███ ███ █▀ ████ ███▄ ▀█████▀ -" ███ ███ - - - - - -" __ ___ ___ __ -" / _` |__ |\ | |__ |__) /\ | -" \__> |___ | \| |___ | \ /~~\ |___ - - -set nocompatible - -set showmatch -set hlsearch -set incsearch -set tabstop=16 - -set softtabstop=4 -set shiftwidth=4 -set autoindent -set number relativenumber -set wildmode=longest,list -" set cc=80 - - - -filetype off -let &runtimepath.=',~/.vim/bundle/neoterm' -filetype plugin on -filetype plugin indent on -syntax on - - -set mouse=v -set mouse=a -set clipboard=unnamedplus -set ttyfast -set cursorline -set splitbelow - -set undofile -set autochdir - -set signcolumn=yes:1 - - - - - - - -" __ __ __ -" |__) | | | / _` | |\ | /__` -" | |___ \__/ \__> | | \| .__/ - -lua require('init') - - - - -" __ __ __ ___ ___ __ -" /__` |\ | | |__) |__) |__ | /__` -" .__/ | \| | | | |___ | .__/ - - -let g:UltiSnipsExpandTrigger="" -let g:UltiSnipsJumpForwardTrigger="jk" -let g:UltiSnipsJumpBackwardTrigger="kj" - -let g:UltiSnipsSnippetDirectories = [$HOME.'/.config/nvim/UltiSnips'] -let g:UltiSnipsEditSplit = 'context' - - - - - - - -" __ __ __ __ __ __ ___ ___ -" / ` / \ | / \ |__) /__` / ` |__| |__ |\/| |__ -" \__, \__/ |___ \__/ | \ .__/ \__, | | |___ | | |___ - - - -set termguicolors -set background=dark - -let g:onedark_config = { - \ 'style': 'darker', -\} -colorscheme onedark - - - - - - -" ___ __ __ __ -" |__/ |__ \ / |__) | |\ | | \ /__` -" | \ |___ | |__) | | \| |__/ .__/ - - - - -let mapleader=" " - -nnoremap tw lua MiniTrailspace.trim() -nnoremap ff Telescope find_files -nnoremap fm NERDTree -nnoremap fc NERDTreeClose -nnoremap tt 12 split Tnew -nnoremap sc TSEnable highlight - -nnoremap zt Twilight -nnoremap zz ZenMode - - -nnoremap v :vsplit ~/.config/nvim/init.vim -nnoremap V :source ~/.config/nvim/init.vim - -" nnoremap s :UltiSnipsEdit -" nnoremap S :call UltiSnips#RefreshSnippets() - -map w CamelCaseMotion_w -map b CamelCaseMotion_b -map e CamelCaseMotion_e -map ge CamelCaseMotion_ge -sunmap w -sunmap b -sunmap e -sunmap ge - - - - - - - diff --git a/lua/init.lua b/lua/bak.lua similarity index 79% rename from lua/init.lua rename to lua/bak.lua index 1203fc3..d763553 100644 --- a/lua/init.lua +++ b/lua/bak.lua @@ -32,7 +32,6 @@ require("lazy").setup({ "navarasu/onedark.nvim", "HiPhish/nvim-ts-rainbow2", "NvChad/nvim-colorizer.lua", - "folke/noice.nvim", "gen740/SmoothCursor.nvim", "folke/twilight.nvim", "folke/zen-mode.nvim", @@ -40,25 +39,88 @@ require("lazy").setup({ "nvim-tree/nvim-web-devicons", "tamton-aquib/staline.nvim", - "willothy/veil.nvim", - { 'echasnovski/mini.nvim', version = false }, "kassio/neoterm", - {"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, - { "SirVer/ultisnips", lazy = true }, - { "lervag/vimtex", lazy = true }, + "willothy/veil.nvim", "bkad/camelcasemotion", "ggandor/lightspeed.nvim", "chentoast/marks.nvim", - { "nvim-neorg/neorg", lazy = true }, - "nvim-lua/plenary.nvim", "tpope/vim-commentary", "preservim/nerdtree", - "nvim-telescope/telescope.nvim", - "nvim-telescope/telescope-file-browser.nvim", + { + "m4xshen/hardtime.nvim", + opts = {} + }, + + { + "folke/noice.nvim", + config = true, + }, + + { + "willothy/veil.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-file-browser.nvim" + }, + config = true, + }, + + + -- size does not matter + { + 'echasnovski/mini.nvim', + version = false + }, + + + -- need that syntax highlight amirite + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate" + }, + + + -- the name says it all + { + "SirVer/ultisnips", + lazy = true + }, + + -- That shmexy latex plugin + { + "lervag/vimtex", + lazy = true + }, + + -- DAMN, org mode? + { + "nvim-neorg/neorg", + lazy = true + }, + + + -- Cool screensaver !! + { + "folke/drop.nvim", + event = "VimEnter", + + config = function() + require('drop').setup + { + ---@type DropTheme|string + theme = "leaves", -- can be one of rhe default themes, or a custom theme + max = 15, -- maximum number of drops on the screen + interval = 100, -- every 150ms we update the drops + screensaver = 1000 * 60 * 1, -- show after 5 minutes. Set to false, to disable + filetypes = { "veil" }, -- will enable/disable automatically for the following filetypes + } + end, + }, }) @@ -73,8 +135,6 @@ require('mini.pairs').setup() require('mini.trailspace').setup() require('mini.hipatterns').setup() require('mini.indentscope').setup() -require('noice').setup() -require('veil').setup() -- require('mason').setup() -- require('mini.files').setup() -- require('mini.statusline').setup() @@ -98,6 +158,11 @@ vim.keymap.set('i', '', [[pumvisible() ? "\" : "\"]], { expr --} + + + + + require('neorg').setup { load = { ["core.defaults"] = {}, -- Loads default behaviour diff --git a/lua/trixy/colors.lua b/lua/trixy/colors.lua new file mode 100644 index 0000000..b798a9a --- /dev/null +++ b/lua/trixy/colors.lua @@ -0,0 +1,6 @@ +vim.opt.termguicolors = true +vim.opt.background = "dark" + +vim.g.onedark_config = { style = 'darker' } +vim.cmd("colorscheme onedark") + diff --git a/lua/trixy/drop.lua b/lua/trixy/drop.lua new file mode 100644 index 0000000..7856218 --- /dev/null +++ b/lua/trixy/drop.lua @@ -0,0 +1,9 @@ +require('drop').setup +{ + ---@type DropTheme|string + theme = "leaves", -- can be one of rhe default themes, or a custom theme + max = 15, -- maximum number of drops on the screen + interval = 100, -- every 150ms we update the drops + screensaver = 1000 * 60 * 1, -- show after 5 minutes. Set to false, to disable + filetypes = { "veil" }, -- will enable/disable automatically for the following filetypes +} diff --git a/lua/trixy/harpoon.lua b/lua/trixy/harpoon.lua new file mode 100644 index 0000000..d40310f --- /dev/null +++ b/lua/trixy/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "ma", mark.add_file) +vim.keymap.set("n", "mm", ui.toggle_quick_menu) + +vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(2) end) +vim.keymap.set("n", "", function() ui.nav_file(3) end) +vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/lua/trixy/init.lua b/lua/trixy/init.lua new file mode 100644 index 0000000..e1118fc --- /dev/null +++ b/lua/trixy/init.lua @@ -0,0 +1,13 @@ +require("trixy.lazy") +require("trixy.neorg") +require("trixy.smoothcursor") +require("trixy.staline") +require("trixy.opts") +require("trixy.colors") +require("trixy.keybind") +require("trixy.treesitter") +require("trixy.harpoon") +require("trixy.drop") +require("trixy.mini") +require("trixy.lsp-zero") +--require("trixy.marks") diff --git a/lua/trixy/keybind.lua b/lua/trixy/keybind.lua new file mode 100644 index 0000000..c422982 --- /dev/null +++ b/lua/trixy/keybind.lua @@ -0,0 +1,44 @@ +local map = vim.api.nvim_set_keymap +local cmap = vim.keymap.set + +local options = { noremap = true } +local cmd_options = { noremap = true, silent = true } + + +local tele = require('telescope.builtin') + +vim.g.mapleader = " " + + + + +-- TELESCOPE +cmap("n", "ff", tele.find_files, options) +cmap("n", "fg", tele.git_files, options) +cmap("n", "fg", tele.git_files, options) + +cmap("n", "fs", function() + tele.grep_string({ search = vim.fn.input("Grep > ") }); +end) + + + + +map("n", "tw", "lua MiniTrailspace.trim()", options) +map("n", "fm", "NERDTree", options) +map("n", "fc", "NERDTreeClose", options) +map("n", "tt", "12 split Tnew", options) +map("n", "sc", "TSEnable highlight", options) +map("n", "zt", "Twilight", options) +map("n", "zz", "ZenMode", options) +map("n", "v", "vsplit ~/.config/nvim/init.lua", options) +map("n", "V", "source ~/.config/nvim/init.lua", options) + + + +map("n", "w", "CamelCaseMotion_w", cmd_options) +map("n", "b", "CamelCaseMotion_b", cmd_options) +map("n", "e", "CamelCaseMotion_e", cmd_options) +map("n", "ge", "CamelCaseMotion_ge", cmd_options) + + diff --git a/lua/trixy/lazy.lua b/lua/trixy/lazy.lua new file mode 100644 index 0000000..57c72ef --- /dev/null +++ b/lua/trixy/lazy.lua @@ -0,0 +1,151 @@ + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + + +-- require("lazy").setup(plugins, opts) + + + + + +require("lazy").setup({ + + "navarasu/onedark.nvim", + "HiPhish/nvim-ts-rainbow2", + + "gen740/SmoothCursor.nvim", + "folke/twilight.nvim", + "folke/zen-mode.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + "tamton-aquib/staline.nvim", + + "kassio/neoterm", + "willothy/veil.nvim", + + "bkad/camelcasemotion", + "ggandor/lightspeed.nvim", + + "tpope/vim-commentary", + + "preservim/nerdtree", + "ThePrimeagen/harpoon", + + + { + "NvChad/nvim-colorizer.lua", + config = function() + require('colorizer').setup() + end, + }, + + + { + "m4xshen/hardtime.nvim", + lazy = true, + opts = {} + }, + + + { + "folke/noice.nvim", + config = true, + }, + + + { + "willothy/veil.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-file-browser.nvim" + }, + config = true, + }, + + + + + + -- size does not matter + { + 'echasnovski/mini.nvim', + version = false, + }, + + + -- need that syntax highlight amirite + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate" + }, + + + -- the name says it all + { + "SirVer/ultisnips", + lazy = true + }, + + -- That shmexy latex plugin + { + "lervag/vimtex", + lazy = true + }, + + -- DAMN, org mode? + { + "nvim-neorg/neorg", + lazy = true + }, + + + -- Cool screensaver !! + { + "folke/drop.nvim", + event = "VimEnter", + }, + + + { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v2.x', + dependencies = { + -- LSP Support + {'neovim/nvim-lspconfig'}, -- Required + {'williamboman/mason.nvim'}, -- Optional + {'williamboman/mason-lspconfig.nvim'}, -- Optional + + -- Autocompletion + {'hrsh7th/nvim-cmp'}, -- Required + {'hrsh7th/cmp-nvim-lsp'}, -- Required + {'L3MON4D3/LuaSnip'}, -- Required + } + }, + +}) + + + + + + + + +vim.opt.laststatus=2 + +vim.keymap.set('i', '', [[pumvisible() ? "\" : "\"]], { expr = true }) +vim.keymap.set('i', '', [[pumvisible() ? "\" : "\"]], { expr = true }) + + diff --git a/lua/trixy/lsp-zero.lua b/lua/trixy/lsp-zero.lua new file mode 100644 index 0000000..58c1369 --- /dev/null +++ b/lua/trixy/lsp-zero.lua @@ -0,0 +1,54 @@ +local lsp = require('lsp-zero').preset({}) + +lsp.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp.default_keymaps({buffer = bufnr}) +end) + +-- (Optional) Configure lua language server for neovim +require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) + +lsp.setup() + + + + +-- You need to setup `cmp` after lsp-zero +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() + +cmp.setup({ + mapping = { + -- `Enter` key to confirm completion + [''] = cmp.mapping.confirm({select = true}), + + + + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, {"i", "s"}), + + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, {"i", "s"}), + + + -- Ctrl+Space to trigger completion menu + [''] = cmp.mapping.complete(), + + -- Navigate between snippet placeholder + [''] = cmp_action.luasnip_jump_forward(), + [''] = cmp_action.luasnip_jump_backward(), + } +}) diff --git a/lua/trixy/marks.lua b/lua/trixy/marks.lua new file mode 100644 index 0000000..eae332d --- /dev/null +++ b/lua/trixy/marks.lua @@ -0,0 +1,20 @@ + + +require'marks'.setup { + default_mappings = true, + builtin_marks = { ".", "<", ">", "^" }, + cyclic = true, + force_write_shada = false, + refresh_interval = 250, + sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 }, + excluded_filetypes = {}, + bookmark_0 = { + sign = "⚑", + virt_text = "hello world", + -- defaults to false. + annotate = false, + }, + mappings = {} +} + + diff --git a/lua/trixy/mini.lua b/lua/trixy/mini.lua new file mode 100644 index 0000000..e28c15a --- /dev/null +++ b/lua/trixy/mini.lua @@ -0,0 +1,5 @@ +require('mini.cursorword').setup() +require('mini.pairs').setup() +require('mini.trailspace').setup() +require('mini.hipatterns').setup() +require('mini.indentscope').setup() diff --git a/lua/trixy/neorg.lua b/lua/trixy/neorg.lua new file mode 100644 index 0000000..47159c8 --- /dev/null +++ b/lua/trixy/neorg.lua @@ -0,0 +1,13 @@ +require('neorg').setup { + load = { + ["core.defaults"] = {}, -- Loads default behaviour + ["core.concealer"] = {}, -- Adds pretty icons to your documents + ["core.dirman"] = { -- Manages Neorg workspaces + config = { + workspaces = { + notes = "~/notes", + }, + }, + }, + }, +} diff --git a/lua/trixy/opts.lua b/lua/trixy/opts.lua new file mode 100644 index 0000000..7afa5f2 --- /dev/null +++ b/lua/trixy/opts.lua @@ -0,0 +1,43 @@ +local o = vim.opt + +o.number = true -- enable line number +o.relativenumber = true -- enable relative line number +o.undofile = true -- persistent undo +o.backup = false -- disable backup +o.autowrite = true -- auto write buffer when it's not focused +o.ignorecase = true -- case insensitive on search.. +o.list = true -- display listchars +o.smartindent = true -- smarter indentation +o.smarttab = true -- make tab behaviour smarter +o.splitright = true -- split right instead of left +o.splitkeep = "screen" -- stabilize split +o.startofline = false -- don't go to the start of the line when moving to another file +o.swapfile = false -- disable swapfile +o.termguicolors = true -- true colours for better experience +o.wrap = false -- don't wrap lines +o.backupcopy = "yes" -- fix weirdness for stuff that replaces the entire file when hot reloading + +o.compatible = false +o.showmatch = true +o.hlsearch = true +o.incsearch = true +o.tabstop = 16 +o.softtabstop = 4 +o.shiftwidth = 4 +o.autoindent = true +o.wildmode = "longest,list" +o.mouse = "v" +o.mouse = "a" +o.clipboard = "unnamedplus" +o.ttyfast = true +o.cursorline = true +o.splitbelow = true +o.autochdir = true +o.signcolumn="yes:1" + + +vim.api.nvim_command("filetype off") +vim.api.nvim_command("let &runtimepath.=',~/.vim/bundle/neoterm'") +vim.api.nvim_command("filetype plugin on") +vim.api.nvim_command("filetype plugin indent on") +vim.api.nvim_command("syntax on") diff --git a/lua/trixy/smoothcursor.lua b/lua/trixy/smoothcursor.lua new file mode 100644 index 0000000..30d8d5d --- /dev/null +++ b/lua/trixy/smoothcursor.lua @@ -0,0 +1,35 @@ + + +require('smoothcursor').setup({ + autostart = true, + cursor = "", -- cursor shape (need nerd font) + texthl = "SmoothCursor", -- highlight group, default is { bg = nil, fg = "#FFD400" } + linehl = nil, -- highlight sub-cursor line like 'cursorline', "CursorLine" recommended + type = "default", -- define cursor movement calculate function, "default" or "exp" (exponential). + fancy = { + enable = true, -- enable fancy mode + head = { cursor = "", texthl = "SmoothCursor", linehl = nil }, + body = { + { cursor = "", texthl = "SmoothCursorYellow" }, + { cursor = "", texthl = "SmoothCursorYellow" }, + { cursor = "●", texthl = "SmoothCursorYellow" }, + { cursor = "●", texthl = "SmoothCursorYellow" }, + { cursor = "•", texthl = "SmoothCursorYellow" }, + { cursor = ".", texthl = "SmoothCursorYellow" }, + { cursor = ".", texthl = "SmoothCursorYellow" }, + }, + tail = { cursor = nil, texthl = "SmoothCursor" } + }, + flyin_effect = nil, -- "bottom" or "top" + speed = 50, -- max is 100 to stick to your current position + intervals = 25, -- tick interval + priority = 10, -- set marker priority + timeout = 1500, -- timout for animation + threshold = 3, -- animate if threshold lines jump + disable_float_win = false, -- disable on float window + enabled_filetypes = nil, -- example: { "lua", "vim" } + disabled_filetypes = nil, -- this option will be skipped if enabled_filetypes is set. example: { "TelescopePrompt", "NvimTree" } +}) + + + diff --git a/lua/trixy/staline.lua b/lua/trixy/staline.lua new file mode 100644 index 0000000..19a58f4 --- /dev/null +++ b/lua/trixy/staline.lua @@ -0,0 +1,56 @@ + + +require('staline').setup { + defaults = { + expand_null_ls = false, -- This expands out all the null-ls sources to be shown + left_separator = "", + right_separator = "", + full_path = false, + line_column = "[%l/%L] 並%p%% ", -- `:h stl` to see all flags. + + fg = "#000000", -- Foreground text color. + bg = "none", -- Default background is transparent. + inactive_color = "#303030", + inactive_bgcolor = "none", + true_colors = true, -- true lsp colors. + font_active = "none", -- "bold", "italic", "bold,italic", etc + + mod_symbol = "  ", + lsp_client_symbol = " ", + lsp_client_character_length = 12, -- Shorten LSP client names. + branch_symbol = " ", + cool_symbol = " ", -- Change this to override default OS icon. + null_ls_symbol = "", -- A symbol to indicate that a source is coming from null-ls + }, + mode_colors = { + n = "#4799eb", + i = "#986fec", + c = "#e27d60", + v = "#2bbb4f", -- etc.. + }, + mode_icons = { + n = " Normal", + i = " Insert", + c = " Command", + v = " Visual", -- etc.. + }, + sections = { + left = { '- ', '-mode', 'left_sep_double', ' ', 'branch' }, + mid = { 'file_name' }, + right = { 'cool_symbol','right_sep_double', '-line_column' }, + }, + inactive_sections = { + left = { 'branch' }, + mid = { 'file_name' }, + right = { 'line_column' } + }, + lsp_symbols = { + Error=" ", + Info=" ", + Warn=" ", + Hint="", + }, +} + + + diff --git a/lua/trixy/treesitter.lua b/lua/trixy/treesitter.lua new file mode 100644 index 0000000..34b1ec4 --- /dev/null +++ b/lua/trixy/treesitter.lua @@ -0,0 +1,15 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + }, +} diff --git a/vimstall.sh b/vimstall.sh index e5cf485..e4e5889 100755 --- a/vimstall.sh +++ b/vimstall.sh @@ -1,10 +1,5 @@ #!/bin/sh -# INSTALL PLUG -sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - - # INSTALL CONFIG -nvim +PlugInstall +"TSInstall c haskell bash go python" #+"MasonInstall bash-language-server clangd gopls texlab" +nvim +"Lazy sync" +"TSInstall c haskell bash go python" #+"MasonInstall bash-language-server clangd gopls texlab"