summaryrefslogtreecommitdiff
path: root/lua/talha/functions.lua
diff options
context:
space:
mode:
authortalha <talha@talhaamir.xyz>2024-04-23 00:43:02 +0500
committertalha <talha@talhaamir.xyz>2024-04-23 00:43:02 +0500
commitf4431f6d75baa71aa23318ea50bea3848f946ab1 (patch)
treeb68fdc45b210d7c8adf2db39a2e7d499ccc1ba6f /lua/talha/functions.lua
parent721ef14cf3906992d8615456493de439ada8e1b8 (diff)
Migrated to lazy.nvim, added neomake, a few remaps
Diffstat (limited to 'lua/talha/functions.lua')
-rw-r--r--lua/talha/functions.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/talha/functions.lua b/lua/talha/functions.lua
index e27e1a2..fdad26c 100644
--- a/lua/talha/functions.lua
+++ b/lua/talha/functions.lua
@@ -87,3 +87,30 @@ function GetHomeDir()
return nil
end
+function GetPlatformBuildCommand()
+ os_ver = vim.loop.os_uname().sysname
+ local build_command = ''
+ if os_ver == 'Linux' then
+ build_command = [[./build.sh]]
+ elseif os_ver == 'Windows' then
+ build_command = [[build.bat]]
+ end
+ return build_command
+end
+
+function SafeCListNav(navdir)
+ -- dir:
+ -- 1 is cnext (forwards)
+ -- -1 is cprev (backwards)
+ local dircmd = ''
+ if navdir == 1 then
+ dircmd = 'cnext'
+ elseif navdir == -1 then
+ dircmd = 'cprev'
+ end
+ local status, result = pcall(vim.cmd, dircmd)
+
+ if status == false then
+ return nil
+ end
+end