Skip to content

Commit

Permalink
Sel 09 Jan 2024 06:28:43 WIB
Browse files Browse the repository at this point in the history
  • Loading branch information
nsetyo committed Jan 9, 2024
1 parent 1317542 commit 7998cc2
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 59 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
node_modules/
.env
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
55 changes: 0 additions & 55 deletions config/nvim/lazy-lock.json

This file was deleted.

6 changes: 3 additions & 3 deletions config/nvim/lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ require("lazy").setup({
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
-- { import = "lazyvim.plugins.extras.lang.typescript" },
-- { import = "lazyvim.plugins.extras.lang.json" },
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "plugins" },
Expand Down
5 changes: 5 additions & 0 deletions config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local opt = vim.opt

opt.colorcolumn = '100'
opt.relativenumber = false
opt.winbar = "%=%m %f"
40 changes: 40 additions & 0 deletions config/nvim/lua/plugins/supertab.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {{
"hrsh7th/nvim-cmp",
dependencies = {"hrsh7th/cmp-emoji"},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end

local luasnip = require("luasnip")
local cmp = require("cmp")

opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {"i", "s"}),
["<S-Tab>"] = 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"})
})
end
}}

0 comments on commit 7998cc2

Please sign in to comment.