diff options
author | talha <talha@talhaamir.xyz> | 2024-04-23 00:43:02 +0500 |
---|---|---|
committer | talha <talha@talhaamir.xyz> | 2024-04-23 00:43:02 +0500 |
commit | f4431f6d75baa71aa23318ea50bea3848f946ab1 (patch) | |
tree | b68fdc45b210d7c8adf2db39a2e7d499ccc1ba6f /lua/talha/functions.lua | |
parent | 721ef14cf3906992d8615456493de439ada8e1b8 (diff) |
Migrated to lazy.nvim, added neomake, a few remaps
Diffstat (limited to 'lua/talha/functions.lua')
-rw-r--r-- | lua/talha/functions.lua | 27 |
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 |