GithubHelp home page GithubHelp logo

jalcine / cmake.vim Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 11.0 1.29 MB

:hammer: CMake functionality within Vim.

Home Page: https://jalcine.github.io/cmake.vim

License: MIT License

Ruby 61.54% CMake 0.25% C++ 0.15% Vim Script 38.06%
cmake plugins ruby viml

cmake.vim's Introduction

Hello, I'm Jacky Alciné.

Looking for a software engineer for your team? Let's talk!

I'm a free/libre open source advocate that has a strong interest in researching how to make non-feudal computing systems for the general public. I post at least once a week to my personal website, occassionally livestream from my home lab and am usually talking about the intersections of technology, humanity and politics on my social networking accounts.

As a F/LOSS advocate, you'll find my recent projects on sourcehut; a libre platform for developers to work on code.

GitHub and its parent company, Microsoft, both willingly support and defend their business relations with the inhumane facets of the US federal government despite championing themselves as a community center and a bastion of the open community.

cmake.vim's People

Contributors

bitdeli-chef avatar gadomski avatar jalcine avatar neozenith avatar richjoyce avatar robturtle avatar vchuravy avatar waffle-with-pears avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmake.vim's Issues

autoload/cmake/buffer.vim bug fix post

18-line
if &l:ft != "cpp" && &l:ft != "c" && &l:ft = "cmake" | return 0 | endif
fix to
if &l:ft != "cpp" && &l:ft != "c" && &l:ft != "cmake" | return 0 | endif

lost "!" in &l:ft = "cmake"

Nothing happens with :CMakeBuild

Hello,

I'm trying this plugin with vim 8.0.

I do like stated in the documentation:

  • :CMakeCreateBuild build
  • :CMakeBuild

It just prints Built all targets but nothing happens, the build directory stays empty. What do I miss?

Build base vim extension.

Write out base vim extension to handle all edge cases.

  • Handle asynchronous runs (fake async is done by overriding b:makeprg temporarily)
  • Handle synchronous runs (invoking via system())

Commands not being defined/sourced

Hi,

I cannot figure this out. No matter what sort of file I open, in whatever directory, I cannot seem to get the 'CMake*' commands available.

I have to manually call:

call cmake#commands#apply_global_commands()
call cmake#commands#apply_buffer_commands()

And then I get the various commands available, but the few I tried do not work because some buffer variables are not defined.

Basically, it seems that the plugin for some reason or another does not see any of files as part of a valid CMake project.

I have tried this with a clean configuration (i.e., with cmake.vim being the only plugin and no vimrc, and get the same results.).

Any ideas what might be going on?

Revive Project

I've been using this project a lot on the side but it's getting really slow. In lieu of me wanting to rebuild it in the open, this serves as a meta-issue of things I need to complete to get it working in a more sane fashion.

Objectives

  • Move from vimrunner to vim-vspec.
  • Add more support for ale.

Add Multiple Build Project Support

CMake allows for a developer to designate their preferred build directory. This can allow for multiple build projects (and thus multiple bits of information about cmake). Adding support for fetching and switching between these build systems would require some heavy changes.

YouCompleteMe Integration is Broken

With the moving of options in YouCompleteMe from Vim to pure Python; more changes and updates to documentation have to occur. The biggest problems is that YCM checks for options too quickly and cmake.vim doesn't get to provide the buffer with options in time.

Failure to Detect YouCompleteMe

I removed YCM recently, and I get the following errors when entering a C++ file:

Error detected while processing function cmake#augroup#on_file_type..<SNR>55_render_for_cpp..cm
ake#flags#inject..cmake#flags#inject_to_ycm:
line    1:
E716: Key not present in Dictionary: ycm == 0
E15: Invalid expression: g:cmake_inject_flags.ycm == 0
line   11:
E121: Undefined variable: g:ycm_extra_conf_vim_data
E116: Invalid arguments for function index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(fla
g)
E15: Invalid expression: index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(flag)
E121: Undefined variable: g:ycm_extra_conf_vim_data
E116: Invalid arguments for function index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(fla
g)
E15: Invalid expression: index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(flag)
E121: Undefined variable: g:ycm_extra_conf_vim_data
E116: Invalid arguments for function index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(fla
g)
E15: Invalid expression: index(g:ycm_extra_conf_vim_data, flag) == -1 && exists(flag)
Error detected while processing function cmake#augroup#on_file_type..<SNR>55_render_for_cpp..cm
ake#flags#inject..cmake#flags#inject_to_syntastic:
line    1:
E716: Key not present in Dictionary: syntastic != 1 | return | endif
E15: Invalid expression: g:cmake_inject_flags.syntastic != 1 | return | endif
line    6:
E171: Missing :endif
Error detected while processing function cmake#augroup#on_file_type:
line    5:
-- More --

I guess you could test cmake.vim without YCM installed to track those errors.

Project cached, need to press ENTER everytime

Everytime when I open a a file in a project which contains a build directory I get:

[cmake] Caching build...[cmake] Cached 0 files for this CMake project.[cmake] Project cached into cmake.vim.Press ENTER or type command to continue

which is quiet annoying.
(besides: the only available command I get is CMakeCreateBuild, all others are unavailable)

I installed cmake.vim by cloning to .vim/bundle/cmake.vim and it seems to get loaded (via pathogen.vim)

Allow Rehashing of Target Sources

Whenever one updates a target's CMakeLists.txt, cmake.vim should update the information relating to that particular target.

  • Make it an optional reload, via a prompt and/or option like g:cmake_reload_target_info.
  • Provide an editor command: :CMakeRehashSources.

Add Vimrunner to Test the Plugin

Using the Vimrunner plugin, I'd like to fully automate the functionality of cmake.vim. The following aspects of things I'd like to test are the following:

  • plugin/cmake.vim
  • autoload/cmake/augroup.vim
  • autoload/cmake/buffer.vim
  • autoload/cmake/cache.vim
  • autoload/cmake/commands.vim
  • autoload/cmake/ctags.vim
  • autoload/cmake/flags.vim
  • autoload/cmake/path.vim
  • autoload/cmake/targets.vim
  • autoload/cmake/util.vim
  • Removed: autoload/cmake/variables.vim

CMake commands do not load at startup.

The CMake help files load up fine but none of the commands are loaded. I generated and briefly scanned a vim log to see if I could pinpoint the problem, but nothing stuck out to me.

Here are my plugins:

Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-unimpaired'
Plugin 'Raimondi/delimitMate'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'Valloric/YouCompleteMe'
Plugin 'hynek/vim-python-pep8-indent'
Plugin 'flazz/vim-colorschemes'
Plugin 'sjl/gundo.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'tpope/vim-surround'
Plugin 'bling/vim-airline'
Plugin 'majutsushi/tagbar'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'msanders/snipmate.vim'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'mileszs/ack.vim'
Plugin 'Shougo/unite.vim'
Plugin 'Shougo/vimproc.vim'
Plugin 'craigemery/vim-autotag'
Plugin 'jalcine/cmake.vim'

Are there any files I can generate / paste to help debug this?
Here is my tree structure:
screen shot 2014-09-23 at 11 30 30 am

Add support for vim-test

I don't know if anyone would find this interesting, but I personally think that something like vim-test would be really nifty to have support for in Vim. A little bit more research would be required from me and a potential feature list would be pending but I can see this being a nice extension to have to cmake.vim.

I'll be looking into until 11 Jan 2015. After then, I should have a feature list of what this'll add to cmake.vim and how it'll impact cmake.vim in terms of support.

Goals

Below are some aspects of goals I'd want to get into the system.

  • Add targets whose names have a matching term like unit, test or etc to vim-test.

Linux support

Hi,
First thanks for the effort, but I was wondering if you've tested your plugin on Linux ?
I've some huge performances problem whenever I activate your plugin.

If you've things I can try, do not hesitate to ask :)

Cheers,

E713 Cannot use empty key for Dictionary

Error detected while processing function cmake#augroup#on_vim_enter..cmake#targe
ts#cache:
line 13:
E713: Cannot use empty key for Dictionary
The function call cmake#targets#cache() throw this error.
I have been commented this call

can't create cmake

[cmake] Configuring project for the first time...
Error detected while processing function cmake#commands#create_build..cmake#util#run_cmake..cmake#util#shell_exec:
line 1:
E121: Undefined variable: g:loaded_dispatch
E15: Invalid expression: g:loaded_dispatch == 1
[cmake] Project configured.

Rip Out References to `make` in place of regular `cmake`

Instead of using make directly, we'll have to let cmake drive the builld process. From a quick grep, the only places still using it are:

autoload/cmake/buffer.vim:66:  let &l:makeprg = "make -C " . g:cmake_root_binary_dir . " " . b:cmake_target
autoload/cmake/util.vim:102:  let l:command = 'make -C ' . cmake#util#binary_dir() . ' ' . a:command

Work With JSON Compilation Database

CMake provides a means of exporting its commands to a lil' old JSON file. We need to tell the integrations to use this file to pull in all of the options necessary for a full-level integration.

Enable Out-Of-Source Build Support

CMake allows for out-of-source builds. This would require a bit of changing of the logic found here so thart one can easily find the CMake generated build files.


Based on #52.

opening arbitrary cpp file not related to cmake project

"main.cpp" 25L, 512C
Error detected while processing function cmake#augroup#on_buf_read..cmake#buffer#has_project..cmake#util#has_project..cmake#util#binary_dir:
line 18:
E121: Undefined variable: b:cmake_root_binary_dir
E116: Invalid arguments for function fnamemodify(b:cmake_root_binary_dir,':p')
E15: Invalid expression: fnamemodify(b:cmake_root_binary_dir,':p')

VIM: Not an editor command

I installed the plugin by vundle, i have cmake version 3.0 and my vim version is 7.4.
However, if i
:CMakeCreateProject build. Vim gives me the error: "Not an editor command"

The test suite gives me a lot of errors, mainly with this message:
"No suitable Vim executable could be found for this system."

That's my ~/.vimrc file: Any help would be great.

"Codigo
set number
syntax on

"Tab configuration
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab

"Paste
set pastetoggle=

"
set foldmethod=marker
set foldmarker={,}

let g:ycm_global_ycm_extra_conf = '/home/edno/.ycm_extra_conf.py'
let g:ycm_path_to_python_interpreter = '/usr/bin/python2'

let g:cmake_cxx_compiler = 'g++'
let g:cmake_build_directories = [ "build" ]

set nocompatible " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"
" " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Valloric/YouCompleteMe'

Bundle 'jalcine/cmake.vim'
" " plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" " Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" " git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" " The sparkup vim script is in a subdirectory of this repo called vim.
" " Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" " Avoid a name conflict with L9
" Plugin 'user/L9', {'name': 'newL9'}
"
" " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" "
" " Brief help
" " :PluginList - lists configured plugins
" " :PluginInstall - installs plugins; append ! to update or just
" :PluginUpdate
" " :PluginSearch foo - searches for foo; append ! to refresh local cache
" " :PluginClean - confirms removal of unused plugins; append ! to
" auto-approve removal
" "
" " see :h vundle for more details or wiki for FAQ
" " Put your non-Plugin stuff after this line

Can't work properly.

vim version: 7.3.762

In master branch and tag 0.2.2, when called :CMakeCreateBuild build, every files are created in current folder but not in the 'build' folder. And the 'buld' foler remained empty.

In tag 0.2.1, when the vim started, there comes an error:

Error detected while processing $HOME/.vim/bundle/cmake.vim-0.2.1/plugin/cmake.vim:
line   44:
E461: Illegal variable name: l:build_dir
Press ENTER or type command to continue

Incorporate Use of Vagrant

Add support for Vagrant to make it a lot easier to test for other platform versions of installed Vim like Debian, Ubuntu and Arch.

Also, provide a target for ubuntu/precise32 to allow for testing on a Travis-ish environment.

  • Test against a Travis environment.
  • Test against latest Debian.
  • Test against latest Arch.
  • Test against latest FreeBSD.

That should cover quite a few basis. Damn you Windows.

Unable to Find CMake Definitions

As reported via: https://twitter.com/SteveDeFacto/status/362950302304972800

Error detected while processing function cmake#commands#create_build..cmake#util#check_for_cmake_definition:
line    1:
E121: Undefined variable: dir
E116: Invalid arguments for function filereadable(dir . "/CMakeLists.txt") | return 0 | endif
E15: Invalid expression: !filereadable(dir . "/CMakeLists.txt") | return 0 | endif
line    2:
E171: Missing :endif
Error detected while processing function cmake#commands#create_build:
line    2:
[cmake] Cannot find `CMakeLists.txt` in '/home/steven/ovgl'.

How do work with YCM?

I can find the 'kwargs' variable, can you write a nice example for use ycm.
cmake_flags = kwargs['client_data']
final_flags += cmake_flags

Abstract out task runners.

In order to make it easy to swap how processes are run in the background, styling and extra things that cmake.vim could help with; cmake#extension is here to provide just that.

Identity Points for Refactoring the API

In order to keep some private implementations private, consider using the s: prefix with objects to hide certain implementation details from end-users.

  • extension code is a hot spot.

Add Support for Finding Files in an Abstract Fashion

I noticed that whilst under a Ninja-style build, I was unable to find a
DependInfo.make file, which, sensibly, doesn't exist. I'll have to abstract
out the file searching logic for those build systems into their respective
extensions.

This blocks #43 and #26 and may even block #42.

Repair Travis Build

Because testing with Travis is getting to be a PITA. Test runs shouldn't show false positives.

README.md: update required for API change

The "Getting Started" section of the README currently indicates:

" Create a new binary directory for your clean project.
:CMakeCreateProject <build-dir-name>

But this part of the API was apparently changed in the last release to CMakeCreateBuild. Since there may be other notes to add regarding the last release, I guess you're the best suited for this update ;-)

Add Ninja support

Ninja is a fast alternative to make, and CMake supports it. If you have never tried it, you should definitely check it out, it's really cool. cmake.vim could benefit from this. To generate Ninja files, this is simply:

$ cmake -GNinja ..

I guess you'd need to adapt this part, and make sure that ninja is called instead of make. FYI, I currently use ninja with vim-dispatch by simply setting makeprg accordingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.