Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
781 changes: 62 additions & 719 deletions init.lua

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions lua/custom/floatingterminal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
vim.keymap.set("t", "<leader><esc>", "<c-\\><c-n>", { noremap = true, silent = true})
local state = {
floating = {
buf = -1,
win = -1,
},
}

local function create_floating_window(opts)
opts = opts or {}
local width = opts.width or math.floor(vim.o.columns * 0.8)
local height = opts.height or math.floor(vim.o.lines * 0.8)

local col = math.floor((vim.o.columns - width) / 2)
local row = math.floor((vim.o.lines - height) / 2)

local buf = nil
if vim.api.nvim_buf_is_valid(opts.buf) then
buf = opts.buf
else
buf = vim.api.nvim_create_buf(false, true)
end

local win_config = {
relative = 'editor',
width = width,
height = height,
col = col,
row = row,
style = 'minimal',
border = 'rounded',
}

local win = vim.api.nvim_open_win(buf, true, win_config)

return { buf = buf, win = win }
end

local toggle_terminal = function()
if not vim.api.nvim_win_is_valid(state.floating.win) then
state.floating = create_floating_window { buf = state.floating.buf }
if vim.bo[state.floating.buf].buftype ~= 'terminal' then
vim.cmd.terminal()
end
else
vim.api.nvim_win_hide(state.floating.win)
end
end

vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {})
vim.keymap.set({ "n", "t" }, "<space>tt", toggle_terminal)
--local buf, win = create_floating_window()

--local buf, win = create_floating_window({width = 100, height = 30})
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions lua/custom/plugins/blink.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
return {
{
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = { 'rafamadriz/friendly-snippets' },

-- use a release tag to download pre-built binaries
version = '1.*',
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',

---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = { preset = 'default' },

appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = 'mono',
},

completion = { documentation = { auto_show = false } },
},
},
}
40 changes: 40 additions & 0 deletions lua/custom/plugins/color-schemes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
require('tokyonight').setup {
styles = {
comments = { italic = false }, -- Disable italics in comments
},
}

-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
end,
},
ui = {
icons = vim.g.have_nerd_font and {} or {
cmd = '⌘',
config = '🛠',
event = '📅',
ft = '📂',
init = '⚙',
keys = '🗝',
plugin = '🔌',
runtime = '💻',
require = '🌙',
source = '📄',
start = '🚀',
task = '📌',
lazy = '💤 ',
},
},
}
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions lua/custom/plugins/guess-indent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
{
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
},
}
39 changes: 39 additions & 0 deletions lua/custom/plugins/independent-plugins.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
return {
{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }

-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()

-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }

-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end

-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
}
19 changes: 17 additions & 2 deletions lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
-- You can add your own plugins here or in other files in this directory!
-- You can add your own custom.plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
unpack(require("custom.plugins.debug")),
unpack(require("custom.plugins.autopairs")),
unpack(require("custom.plugins.nvim-ufo")),
unpack(require("custom.plugins.blink")),
unpack(require("custom.plugins.independent-plugins")),
unpack(require("custom.plugins.todo")),
unpack(require("custom.plugins.guess-indent")),
unpack(require("custom.plugins.color-schemes")),
unpack(require("custom.plugins.tree_sitter")),
unpack(require("custom.plugins.telescope")),
unpack(require("custom.plugins.indent_line")),
unpack(require("custom.plugins.lint")),
unpack(require("custom.plugins.gitsigns")),
unpack(require("custom.plugins.which-key")),
}
File renamed without changes.
Loading
Loading