Skip to content

Commit

Permalink
plugins + no doc + kemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadiarch committed Dec 14, 2023
0 parents commit fb2aa6b
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## My Config

this is my lunarvim config
26 changes: 26 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Example configs: https://github.com/LunarVim/starter.lvim
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny

require("options")
require("keymaps")
require("doc")
require("plugins")
require("myplugins")
require("LSP")














17 changes: 17 additions & 0 deletions lua/LSP/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


local lspconfig = require("lspconfig")

lspconfig.emmet_ls.setup({
on_attach = function(client)
client.resolved_capabilities.document_formatting = false
end,
filetypes = {
"html",
"css",
"javascript",
"typescript",
"jsx",
"tsx",
},
})
27 changes: 27 additions & 0 deletions lua/doc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@


-- windows path
vim.cmd([[
command! Vimrc tabe C:\Users\mohammadi\AppData\Local\lvim\config.lua
command! VimrcL tabe C:\Users\mohammadi\AppData\Roaming\lunarvim\lvim\init.lua
command! WhichKeyDoc tabe C:\Users\mohammadi\AppData\Roaming\lunarvim\lvim\lua\lvim\core\whick-key.lua
command! DocAll tabe C:\Users\mohammadi\AppData\Roaming\awesome-cheatsheets\Readme.md
command! DocGit tabe C:\Users\mohammadi\AppData\Local\lvim\doc\git.md
command! DocLvim tabe C:\Users\mohammadi\AppData\Local\lvim\doc\lvim.md
command! DocLua tabe C:\Users\mohammadi\AppData\Local\lvim\doc\lua.md
command! DocLinux tabe C:\Users\mohammadi\AppData\Local\lvim\doc\linux.md
command! DocCmd tabe C:\Users\mohammadi\AppData\Local\lvim\doc\cmd.md
command! DocE tabe C:\Users\mohammadi\AppData\Local\lvim\doc\e.md
command! DocInstall tabe C:\Users\mohammadi\AppData\Local\lvim\doc\install.md
command! DocTutorVim tabe C:\Users\mohammadi\AppData\Local\lvim\doc\vim.tutor.md
]])




-- linux


46 changes: 46 additions & 0 deletions lua/keymaps.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

local wk= require("which-key")


-- vim.api.nvim_set_keymap("n", "<F5>", "<cmd>!python % <CR>", {}) -- run programs
vim.api.nvim_set_keymap("n", "qq", ":qa!", {}) -- press enter to exit
vim.api.nvim_set_keymap("n", "wq", ":wqa!", {}) -- press enter to save and exit
vim.api.nvim_set_keymap("i", "jj", "<ESC>", {}) -- press jj for nodrmal mode [a-o-i== insert mode]




-- Run Programs by space+r inside vim
local function run_curr_python_file()

local name=vim.fn.expand('%:t')
if vim.fn.expand('%:e'):match('[^.]+$') == 'py' then
vim.api.nvim_feedkeys(":ToggleTerm\npython "..name.."\n","n", false)

end
if vim.fn.expand('%:e'):match('[^.]+$') == 'js' then
vim.api.nvim_feedkeys(":ToggleTerm\nnode "..name.."\n","n", false)
end
end

vim.keymap.set({'n'}, '<space>r', '', {
desc = "Run .py file via Neovim built-in terminal",
callback = run_curr_python_file
})


-- flash.nvim
wk.register({
m={
name="me: flash",
j={function() require('flash').jump() end, "flash jump"},
t={function() require('flash').treesitter() end, "flash treesitter"},
r={function() require('flash').treesitter_search() end, "flash treesitter search"},
}
},{prefix = "<leader>"})






56 changes: 56 additions & 0 deletions lua/myplugins/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@



require("telescope").load_extension "file_browser"
require'telescope'.load_extension('project')


vim.api.nvim_set_keymap(
"n",
"<space>b",
":Telescope file_browser<CR>",
{ noremap = true }
)

-- open file_browser with the path of the current buffer
vim.api.nvim_set_keymap(
"n",
"<space>b",
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
{ noremap = true }
)

-- see markdown inside neovim
require('glow').setup({
style = "dark",
width = 120,
})


require("scrollbar").setup()






require('code_runner').setup({
filetype = {
java = {
"cd $dir &&",
"javac $fileName &&",
"java $fileNameWithoutExt"
},
python = "python -u",
typescript = "deno run",
rust = {
"cd $dir &&",
"rustc $fileName &&",
"$dir/$fileNameWithoutExt"
},
},
})




26 changes: 26 additions & 0 deletions lua/options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

-- Enable powershell as your default shell
vim.opt.shell = "pwsh.exe"
vim.opt.shellcmdflag =
"-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.cmd [[
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote= shellxquote=
]]

-- Set a compatible clipboard manager
vim.g.clipboard = {
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
}


lvim.builtin.bufferline.options.numbers = "ordinal"
vim.opt.guifont = "Fira Nerd Font Mono"
45 changes: 45 additions & 0 deletions lua/plugins.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@



lvim.plugins={
{
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
},
"nvim-telescope/telescope-project.nvim",
"ellisonleao/glow.nvim", -- you should install glow -- windows: choco install glow
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
"CRAG666/code_runner.nvim",
-- you need to install install code-minimap
-- windows: ------> scoop bucket add extras -----> scoop install code-minimap
"wfxr/minimap.vim",
"petertriho/nvim-scrollbar",
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
-- keys = {}, -- set in keymaps.lua
},
"Exafunction/codeium.vim",
-- {
-- "Exafunction/codeium.vim",
-- config = function ()
-- -- Change '<C-g>' here to any keycode you like.
-- vim.keymap.set('i', '<M-g>', function () return vim.fn['codeium#Accept']() end, { expr = true })
-- vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
-- vim.keymap.set('i', '<c-y>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
-- vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
-- end
-- }
}

0 comments on commit fb2aa6b

Please sign in to comment.